rotation matrices

Started by
3 comments, last by Zakwayda 18 years, 8 months ago
Hi, I read a lot of matrices in the net now. I also read several examples for rotation matrices, which are used in 3D applications. In every tutorial and article I found only this information: matrix for z-axis rotation:

cos(a) sin(a)  0 0 
-sin(a) cos(a) 0 0
0      0       1 0
0      0       0 1
... and the matrices for x and y rotation, too. I understand how to built the matrices, but I still dont know if I can multiply them to get a matrix, which contains all rotations!? For example: (Matrix for x-axis rot.) * (Matrix for y-axis rot.) *(Matrix for z-axis rot.) = (Matrix with x,y and z axis rotation) Would that work?
Advertisement
Yes, that would work, and the rotations will be carried out in the order you multiply them together.
Would the order I multiply them together take an effect of the result(I think no)? Or do you mean something different?
Thanks for the help!
The order of multiplication is significant; matrix multiplication is non communicative.
You can multiply the matrices together in pretty much any order you want (although the results will usually differ). Examples of different orders include XYZ, YZX, ZYZ, ZY, XY, etc. (You can easily work out all the permutations yourself.)

As for what order the rotations are applied in, that depends on whether you're using row or column vectors. Take the multiplication order XYZ. With row vectors, you have:

v' = v*X*Y*Z

And so the order of application is the same as the order of multiplication. With column vectors:

v' = X*Y*Z*v

The order of application is the reverse of the order of multiplication.

This topic is closed to new replies.

Advertisement