View Full Version : Rotation about an arbitrary axis

11-25-2005, 02:15 AM
Hi all!

I have created a matrix to rotate about an arbitrary axis. The matrix is right(I have checked it in the internet)

The problem is when i use it like this:

SetupMatrixRotateAxis(matrix, axis.x, axis.y, axis.z, angle); // where axis.x = axis.y = 1, axis.z = 0

angle += 0.1;

the object seems to be rotated about 1, 1, 0 axis but also is scaled in x, y directions

Can anyone tell me what is happening?

11-25-2005, 02:29 AM
Something is obviously wrong with the matrix since you get some scaling effect in a rotation matrix. Post the code for SetupMatrixRotateAxis.

11-25-2005, 03:48 AM
Did you normalize the rotation axis? The x, y and z values used to construct the rotation matrix must form a unit vector, or the matrix will contain a scaling.

12-06-2005, 04:00 PM
also pay attention to major/minor row order...