Phone: 905 409-1589
Email: info@penproductions.ca
RSS LinkedIn Twitter Twitter
Tutorials:
Transform Matrix:

Matrix3 demo file: matrix3.zip
Normalized Matrix Matrix skewed with the Z axis.

All position rotation and scale of object are stored in a 3 x 4 matrix in max script it can be shown on an object with the same BOX01 by typing $BOX01. Transform in the MXS listener and pressing enter. The result will be (MATRIX 3 [1,0,0] [0,1,0] [0,0,1] [0,0,0]) This matrix would represent an object that has a position of [0,0,0], a rotation of [0,0,0], and a scale of 100%. The first three sets of values represent the XYZ rotation and scale, and the forth set is the XYZ position.

The XYZ for rotation are position vector and not rotation values. A visual representation of the matrix would look like this.

Calculating a position from a matrix3 value is easy since there is a separate vector value representing it. Scale is the next easiest to understand. If we were to scale an object along its X-axis by 200% the matrix would have a value of (MATRIX3 [2,0,0] [0.1,0] [0,0,1] [0,0,0]) and would look like.

A rotation is done by moving the three rotation and scale vectors. To rotate the Y and Z-axis, a rotation value of 45 degrees around the X axis will have a matrix value of (MATRIX3 [1,0,0] [0,.707,-.707] [0,.707,.707] [0,0,0]). This will look like.

Knowing that the rotation and scale value are woven together it is understandable why a non-uniformly scaled object in a hierarchy will cause its child object to skew when rotated. I will show this in a later example.