# rotation matrices

This topic is 5195 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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?

##### Share on other sites
Yes, that would work, and the rotations will be carried out in the order you multiply them together.

##### Share on other sites
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!

##### Share on other sites
The order of multiplication is significant; matrix multiplication is non communicative.

##### Share on other sites
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.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 13
• 11
• 23
• 41
• 75