Advertisement

Article #02: Matrices

Started by December 30, 2005 09:48 AM
2 comments, last by Dani008 18 years, 8 months ago
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?
Thanks
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.
Advertisement
Mathworld
"Are you threatening me, Master Jedi?" - Chancellor Palpatine
Ohh you are right, thanks.
Thanks

This topic is closed to new replies.

Advertisement