Jump to content
  • Advertisement
Sign in to follow this  
Dani008

Article #02: Matrices

This topic is 4705 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

Hello, I'm wondering why there are different results when I use OpenGL's glRotatef_() 2 times and multiplying 2 rotationmatrices. And I want to know how to use a matrix on a vector(without OpenGL or DirectX or other renderers). And when I multiply the identity matrix with a rotationmatrix I'll get this:
 /                 \     /                                \     /                                
|  1.0 0.0 0.0 0.0  |   |  1.0  0.0        0.0        0.0  |   |  1.0  0.0        0.0        0.0  |
|  0.0 1.0 0.0 0.0  | * |  0.0  Cos(angle) Sin(angle) 0.0  | = |  0.0  Cos(angle) 0.0        0.0  |
|  0.0 0.0 1.0 0.0  |   |  0.0 -Sin(angle) Cos(angle) 0.0  |   |  0.0  0.0        Cos(angle) 0.0  |
|  0.0 0.0 0.0 1.0  |   |  0.0  0.0        0.0        1.0  |   |  0.0  0.0        0.0        1.0  |
 \                 /     \                                /     \                                /
hopefully you can see it, if not copy it into notepad. Can you help me with this?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You're not doing matrix multiplication. You are multiplying each element of the matrix by the corresponding element of the other matrix. Matrix multiplication is something completely different.

Google for matrix multiplication, and you will find the correct algorithm.

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!