All pastes #323127 Raw Edit

Stuff

public text v1 · immutable
#323127 ·published 2007-01-21 01:25 UTC
rendered paste body
#! /usr/bin/python

from vtk import *

# create a rendering window and renderer
ren = vtkRenderer()
renWin = vtkRenderWindow()
renWin.AddRenderer(ren)
renWin.SetSize(800,600)
renWin.StereoCapableWindowOn()

iren = vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
trackcam = vtkInteractorStyleTrackballCamera()
iren.SetInteractorStyle(trackcam)



# create an actor and give it cube geometry
matchstick1 = vtkCubeSource()
H = 0.3
matchstick1.SetCenter(1,0, ((H/2) - 0.5) )
matchstick1.SetZLength(H)
#matchstick1.SetCenter(1,0,(H/2))

print((H/2))
matchstick1.SetXLength(1);
matchstick1.SetYLength(1);
matchstickMapper1 = vtkPolyDataMapper()
matchstickMapper1.SetInput(matchstick1.GetOutput())
matchstickActor1 = vtkActor()
matchstickActor1.SetMapper(matchstickMapper1)


matchstick = vtkCubeSource()
matchstick.SetZLength(1);
matchstick.SetXLength(1);
matchstick.SetYLength(1);
matchstickMapper = vtkPolyDataMapper()
matchstickMapper.SetInput(matchstick.GetOutput())
matchstickActor = vtkActor()
matchstickActor.SetMapper(matchstickMapper)

# assign our actor to the renderer
ren.AddActor(matchstickActor)
ren.AddActor(matchstickActor1)

# enable user interface interactor
iren.Initialize()
iren.Start()