Jump to content
  • Advertisement
Sign in to follow this  

Article #02: Matrices

This topic is 4525 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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!