[vtkusers] VTK, rotate about two points

Bill Lorensen bill.lorensen at gmail.com
Tue Jan 5 17:03:57 EST 2010


If you use PolyDataTransform, a new set of points is produced. It is a filter.

If you use vtkActor's rotate, the transform is handled by OpenGL (i.e.
no new points are produced).


On Tue, Jan 5, 2010 at 4:58 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list