[vtkusers] VTK, rotate about two points

Peter Halverson halverson at byu.edu
Wed Dec 16 13:11:04 EST 2009


I'm using python and VTK to attempt to rotate an actor around two arbitrary
points. I would like to rotate it about 2 degrees about point a and then 2
deg. about point b. Instead it rotates it 4 degrees about point b. What am I
doing wrong. Do I have to use update? My code is below thanks for your help.

stl=vtk.vtkSTLReader()
stl.SetFileName("Data/file.stl")
stl.Update()

mapper=vtk.vtkPolyDataMapper()
mapper.SetInput(stl.GetOutput())

actor=vtk.vtkActor()
actor.SetMapper(mapper)

actor.SetOrigin((0,0,0))
actor.RotateX(2)
mapper.Update()

actor.SetOrigin((20,20,20))
actor.RotateX(2)
mapper.Update()

renWin.Render()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091216/3b1e0a9e/attachment.htm>


More information about the vtkusers mailing list