Transformation Matrix

Ron Inbar rinbar at netvision.net.il
Wed Jul 28 17:37:47 EDT 1999


Hi Ana!

> Hi, I'm rotating and moving my actors, a bit like in the flamingo example.
> I'd like to get the transform matrix that converts my actor from the
> original position and scale to the new one. I'm using
vtkActor->GetMatrix()
> but I don't quite understand the results I obtain. For example, if I scale
> the object the matrix I obtain is
>
>
>     1.30565 0 0 -33.9091
>     0 1.30565 0 -33.6466
>     0 0 1.30565 -33.6215
>     0 0 0 1
>
> and the 1.3065 corresponds to the scaling (as I can see if I call
> vtkActor->GetScale()) shouldn't the scale factor be in the last row?
>

No, it shouldn't.  To understand how it works, try (pre-) multiplying the
vectors (0 0 0 1), (1 0 0 1), (0 1 0 1) and (0 0 1 1) by this matrix.  O =
(0 0 0 1) represents the actor's origin, and is transformed into T(O) =
(-33.9091 -33.6466 -33.6215 1), the location of this point in world
coordinates, which is returned by GetOrigin().  Now take X = (1 0 0 1) = O +
(1 0 0 0).  X is transformed into T(X) = T(O) + T(1 0 0 0) = T(O) + (1.30565
0 0 0).  Similarly, Y = O + (0 1 0 0) is transformed into T(O) + (0 1.30565
0 0), and Z = O + (0 0 1 0) is transformed into T(O) + (0 0 1.30565 0).
What all this means is that the actor is first translated to
(-33.9091 -33.6466 -33.6215) and then stretched by a factor of 1.30565
around the origin (i.e., the origin remains stationary).

> If now I rotateY 90 degrees the matrix remains the same, even if the
> orientation of the actor has changed.

This really doesn't seem to make sense, but then, I'm a VTK newbie myself.
Perhaps you are extracting the wrong matrix?  (Just a shot in the dark.)

>
> Isn't there a way to obtain the matrix?
>
> TIA,
>
> Ana
>
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
>
> --------------------------------------------------------------------------
---
> This is the private VTK discussion list.  Please keep messages on-topic.
> Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
> To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
> <majordomo at gsao.med.ge.com>.  For help, send message body containing
> "info vtkusers" to the same address.     Live long and prosper.
> --------------------------------------------------------------------------
---
>
>



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list