[vtkusers] origin problems
bthomas at engineering.uiowa.edu
Wed Jun 12 14:12:20 EDT 2002
I am helping to develop a image rendering tool using python and vtk. I have
set up the rendering window so that rotations actually rotate the objects in
the scene and not the camera. Now I am trying to put in text and write a
method that will allow my text to be similar to a vtkFollower object where it
always faces the camera. The problem is I can't seem to change the origin of
the text object so I can rotate it about its local origin instead of the world
origin so I end up just getting text that doesn't move at all because it
negates the original rotation. Is it only possible to have one origin for all
rotations or can I have a seperate origin for each object that can be changed?
This is part of my code:
def FaceCamera(self, w, x, y, z):
""" used for text so that it rotates back about its local axis to face
origin = self.actor.GetOrigin()
#rotate opposite original rotation about own origin
self.actor.RotateWXYZ(-w, x, y, z)
self.actor.SetOrigin(origin, origin, origin)
But the rotation takes place about the origin instead of the self.localOrigin.
Thanks for any help.
More information about the vtkusers