Rotation about an arbitrary axis

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?

Something is obviously wrong with the matrix since you get some scaling effect in a rotation matrix. Post the code for SetupMatrixRotateAxis.

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.

also pay attention to major/minor row order…