[vtkusers] VTK, rotate about two points

David Doria daviddoria+vtk at gmail.com
Tue Jan 5 16:58:49 EST 2010


On Wed, Dec 16, 2009 at 1:11 PM, Peter Halverson <halverson at byu.edu> wrote:
> 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()
>

Peter,

Did you ever figure out the problem? Can someone explain the
difference between actor.RotateX and applying a transform to the data
with vtkPolyDataTransform?

Thanks,

David



More information about the vtkusers mailing list