[vtkusers] Exact order of rotations in transformation matrix?

Timo Frenzel rohlof at gmx.de
Thu Oct 21 18:12:32 EDT 2004


Hi,

I've build a 3D modell. In this modell I got another coordinate system with
coordinates which are exact projected in the initial coordination system
(x-,y- and z-axis are vectors in the initial system).
Now i wanna get the rotation angles of my transformation matrix, therefore i
have to know the order of rotations in the usertransform by a 4x4 matrix.
Then i am able to reconstruct the angles with trigonometrical connections of
the matrix elements. Because any order of rotation causes another rotation
matrix.
The vtkProp3D says that the order of rotation in use with
vtkProp3D::SetOrientation(float[3]) is Z,X,Y. But if i try this to get a
rotation matrix it does not seem correct. Just a minimal or non-existing
rotation about the x-axis gets a exact orientation of an actor.

The transformation matrix for Z,X,Y order:
x=angle about X-axis, y=angle about Y-axis and z=angle about Z-axis.
s=sin, c=cos
  |-------------------------|-----------|-------------------------|--|
  |c(y)*c(z)-s(x)*s(y)*s(z) |-c(x)*s(z) |s(y)*c(z)+s(x)*s(y)*s(z) |0 |
  |                         |           |                         |  |
  |c(y)*s(z)+s(x)*s(y)*c(z) |-c(x)*c(z) |s(y)*s(z)-s(x)*c(y)*c(z) |0 |
T=|                         |           |                         |  |
  |-c(x)*s(y)               |s(x)       |c(x)*c(y)                |0 |
  |-------------------------|-----------|-------------------------|--|
  |           0             |     0     |             0           |1 |
  |-------------------------|-----------|-------------------------|--|



May anybody help me? Thx in advance, Timo Frenzel.




More information about the vtkusers mailing list