[vtkusers] Problem in understanding the VTK transformation sequency y-x-z

Rasmus Reinhold Paulsen rrp at imm.dtu.dk
Mon May 30 10:03:02 EDT 2005


Hi,

A simple thing is about to make my head explode.

In a certain situation I want to represent the orientation of an
object (an airplan f.ex.) as three (Euler) angles. To keep the
air-plane language I call these three angles:

Azimuth (around the y-axis)
Elevation (around the x-axis)
Roll (around the z-axis)

This is in accordance with Figure 3-15 of "the VTK book".

Now I want to construct a transformation based on these angles. This 
transformation should be applied to my air-plane model. The model is
defined so the head of the plane points out of the z-axis.

Intuitively, I would first do the roll by rotating around the z-axis
of the global coordinate system. Then I would rotate around the x-axis
to get the elevation and finally do the Azimuth by a rotation around
the y-axis.

In the default pre-multiply mode this is formulated like:

transform->RotateY(azimuth);
transform->RotateX(elevation);
transform->RotateZ(roll); // <- This is done first

However, when I look at the VTK documentation (VTK book, p.50 f.ex.) I 
find that the rotations are applied in the order of 
azimuth->elevation->roll (= y-x-z). This confuses me!

Using the vtkProp3D::SetOrientation on an actor with this notation:

AirPlaneActor->SetOrientation(elevation, azimuth, roll);

does not work well. Letting for example roll go from -45 to 45 degrees
does not make the airplane rotate around itself, but something
completely different.

So my confusion comes from the fact that Figure 3-15 exists and that
the VTK rotation sequency is y->x->z and not z->x->y.

What have I missed?

Best regards,
Rasmus 





More information about the vtkusers mailing list