PDA

View Full Version : OpenGL Matrices



LTJ
01-05-2002, 04:49 AM
what's the correct oder of elements in OpenGL? is it:

0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15

or

0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15

01-05-2002, 05:10 AM
It's depend on the notation you use, if you use
pre-concatenated matrix this layout is use:

0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15

or if you use post-concatenated matrix this layout is use:

0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15

Did you see that, both representation is transpose each other. and the code you use to concatenate matrix is the same.

Tron
01-05-2002, 07:47 AM
per definition it's
0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15
post-multiplied