[vtkusers] Global Rotations and Translations

Andrew Dolgert ajd27 at cornell.edu
Fri Oct 31 15:03:08 EST 2003


Hi John,

I was trying to get this straight, myself.  vtkTransform is a simple
object which does not shift the global axes.  I would hope that what you
want to do requires only that you create a transform which translates
the object from the origin and then rotates it, R*T, and then poke it
into vtkActor->SetUserTransform().

When you lay out the coordinate systems for VTK, they look pretty clear.
There are three coordinate systems, Screen, World, and Actor, and they
are connected by transformations
Screen - s_M_v v_M_w - World - w_M_a - Actor.
VTK expresses everything from the world's perspective, so the
UserTransform in vtkActor is a matrix which transforms world points to
actor points, or a_M_w.  It's that matrix you want to set.  If you are
doing something funky, like rotating the actor about a world position by
rotating all of the points, p, in its vtkPolyData, then you have to do
the traditional linear algebra thing, where R*w_M_a*p = w_M_a*R'*p so
that R' = a_M_w * R * w_M_a in the actor's coordinate system.

- Drew




More information about the vtkusers mailing list