
Title:
Rotation Times Rotation  Interactive 3D Graphics

Description:

One reason that we use four by four matrices to store transforms is that a

single matrix can hold any number of transforms at once. As an example, consider

object three D's rotation paratmeter. Here is a snipet of code from the oil

angler demo. The airplane's three rotation axis are already set. This means that

the airplane is first rotated around its z axis then its y axis, then x.

Internally a transform matrix is made for each rotation. Then these are

multiplied together. Matrix multiplication works like this. For each location in

the resulting matrix, you take the corresponding row of the first matrix.

[inaudible] And the column of the second matrix, and perform a dot product

between these two. For example, to compute element n two four, I compute the dot

product of the fourth row of the first matrix, and the second column of the

second matrix. This gives this set of terms here, added together gives n two

four, 16 dot products later and you have the resulting matrix. To multiply

together our three rotation matrices. We can start at either end. Multiplying Rx

by Ry or Ry by Rz. I've decided to start with Ry and Rz. Multiplying these

together we get some temporary matrix U. We can then multiply together the X

rotation matrix by this temporary matrix. This gives us another matrix call it Q

which consists of all three rotation matrices multiplied together. This

resulting matrix Q can then be used to transform coordinates when an object

coordinate is transformed by this single matrix the coordinate in fact is

rotated by the three rotation matrices in turn it's clearly more efficient to

use a single matrix than three. The scale and translation parameters in the

object 3d class do the same thing. They create matrices and these all get

multiplied together. Here's the full sequence of transforms that happen for an

object 3d when using its parameters: scale, the 3 rotations, and translate.

Internally, these matrices are all multiplied together to give a single

resulting matrix m. The parameter in the object 3D class, is, in fact, called

matrix. You can now see why I've been listing the order of matrices as from

right to left. As this is the order we use for multiplying them together.

Multiplying matrices together like this is called concatenation.