[vtkusers] Camera following actor
Julian Guerrero
juliang at ece.ubc.ca
Tue Jun 17 18:30:54 EDT 2003
Hi,
I've been trying to get a camera to follow an actor by using
SetFocalPoint(), SetPosition() and SetViewUp() methods.
I have a plane with a texture mapped to it that moves around. I want the
camera to follow this plane, so that it shows only one face of the plane
(so if the plane is the only actor, I can see no movement). The plane has
a vtkTransform which is updated from a location sensor, so the location
of the plane will change for each Render() call.
I define 3 points (without the transformation) with respect to the plane
that give me the focal point, position and viewup respectively. Then I use
vtkTransform->MultiplyPoint(...) in order to get the new transformed
points. I feed these to SetFocalPoint(), SetPosition() and SetViewUp().
It seems that SetFocalPoint() and SetPosition() work OK, as I can see the
plane with the texture in the middle of the viewport, but the orientation
of the plane is not stable (I get plane movement, but the plane should
not move..) and the "up" direction does not coincide with what I believe
it should be.
Any ideas? Suggestions? I appreciate any help , and thanks for your
time...
Julian
More information about the vtkusers
mailing list