[vtkusers] Writing a rotated vtkcubesource in a .vtp file
cory.quammen at kitware.com
Wed Jul 22 14:18:30 EDT 2015
You'll need to translate your cube by the negated center of the cube, then
rotate. You can do this all in the same vtkTransform object.
On Wed, Jul 22, 2015 at 1:58 PM, ishantembhekar <ishan.tembhekar at caltech.edu
> Hi Cory,
> Thank you so much for your immediate response! The
> vtkTransformPolyDataFilter worked and it now gives me a rotated cube. I
> replaced the mapper and the actor with the following lines:
> //create a rotation object
> vtkSmartPointer<vtkTransform> rotation =
> //the angle is measured in degrees for some reason
> //use this rotation object in a transformFilter
> vtkSmartPointer<vtkTransformPolyDataFilter> transformFilter =
> However, it is rotating about the z-axis and the origin (as shown in the
> image I attached). What can I do for it to rotate about the center of the
> cube? I tried using SetCenter for both the vtkTransform and the
> PolyDataFilter but they do not have that method. Any ideas?
> Thanks once again!
> View this message in context:
> Sent from the VTK - Users mailing list archive at Nabble.com.
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> Please keep messages on-topic and check the VTK FAQ at:
> Search the list archives at: http://markmail.org/search/?q=vtkusers
> Follow this link to subscribe/unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers