Jump to content
  • Advertisement
Sign in to follow this  
blinkster

rotation matrices

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Yes, that would work, and the rotations will be carried out in the order you multiply them together.

Share this post


Link to post
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 this post


Link to post
Share on other sites
The order of multiplication is significant; matrix multiplication is non communicative.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!