Rotation Matrix

Dear All,

In the Appendix F part of Red book there is
formula for ModelViewMatrix(in the Rotation section) given by

M = UUT + cosa(I - uuT) + (sina)S.

What this formula stands for and where it can be used.

Could you please explain this formula.

With regards

M is the rotation matrix “part” of the ModelView matrix. I think the purpose of the text is to explain the details about the ModelView matrix and glRotate. The formula can be used if you want to set the ModelView matrix yourself without using glRotate. Some similar texts:

The above formula is used in Billboard examples.what is the logic and why is it used in Billboarding examples.

With regards

Searching for “billboard” in the red book only gave me the example with the tree. I did not found any reference to the above formula.

A call to glRotate generates a matrix that is concatened to the current ModelView matrix with a multiplication. The formula for generating the matrix from glRotate*(a, x, y, z) is your formula as described in the appendix. You can generate a matrix with it and multiply the current ModelView matrix. Check that the effect is the same as a call to glRotate.