WillieD
November 25, 2005, 2:15am
#1
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
glMultMatrix(matrix);
…
…
…

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?

Bob
November 25, 2005, 2:29am
#2
Something is obviously wrong with the matrix since you get some scaling effect in a rotation matrix. Post the code for SetupMatrixRotateAxis.

memfr0b
November 25, 2005, 3:48am
#3
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.

dmy
December 6, 2005, 4:00pm
#4
also pay attention to major/minor row order…