Euler Angles
 
 
 

Multiple rotations are not independent. When you rotate something twice, the second rotation rotates the first rotation. For this reason, the order of rotation is important. The 3ds Max Euler angle controller, by default, has an XYZ ordering. That is, the first rotation is done along the X axis, then along the Y axis, and finally along the Z axis. In other words, the default Euler angle controller has a type of EULERTYPE_XYZ (described below). The 3ds Max local Euler angle controller is similar, but specifies rotations around an object's local coordinates instead of the world coordinates. It has a type of (EULERTYPE_XYZ | EULERTYPE_RF).

The SDK provides functions for converting from a Matrix3 to Euler angles using various rotation orderings. The angles are returned here in the same order as specified by type (for example EULERTYPE_XYZ would be ang[0]=x, ang[1]=y, ang[2]=z.) You need the different types because you get different interpolation of the float values with the each type. These types are: one of the following values:

EULERTYPE_XYZ
EULERTYPE_XZY
EULERTYPE_YZX
EULERTYPE_YXZ
EULERTYPE_ZXY
EULERTYPE_ZYX
EULERTYPE_XYX
EULERTYPE_YZY
EULERTYPE_ZXZ

Note: Internally, 3ds Max uses static coordinate frames. Set the EULERTYPE_RF bit (by OR'ing it with the value) if you have a special need to use a rotating coordinate frame. This is described in Ken Shoemaker's paper in Graphic Gems IV, pp. 222-229.

The Euler conversion functions are: