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.

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 on other sites
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 on other sites
Ohh you are right, thanks.

• 10
• 18
• 14
• 18
• 15