Actually Michael, what you said previously, i.e.:
Originally posted by Michael Steinberg:
I wanted to state that only the “names” of the elements are flipped in opengl. The matrices always look equal. So gorg, I might have explained me bad, but I wasn’t discussing to calculate differently with opengl matrices. The problem was, that a mathemacian would store the first row in offsets 0, 1, 2, 3 but opengl has it in 0, 4, 8, 12 (all memory offsets). Elixer not only output the matrix incorrectly, he was actually calculating with the wrong offsets.
is correct. The matrix should be written in the form:
x_axis_x y_axis_x z_axis_x trans_X
x_axis_y y_axis_y z_axis_y trans_y
x_axis_z y_axis_z z_axis_z trans_z
x_axis_w y_axis_w z_axis_w trans_w
This is true for OpenGL aswell as math notation, the only difference between the two is what element the index points to. Standard math notation is row-major, that means the elements are labeled like this:
00 01 02 03
04 05 06 07
08 09 10 11
12 13 14 15
OpenGL uses row-major ordering which means the elements are labeled like this:
00 04 08 12
01 05 09 13
02 06 10 14
03 07 11 15
But although the numbering is different it’s still the same matrix that I printed out at the beginning. However if you use a two dimensional array for your matrix it will be row-major and wrong for OpenGL. It’s still the same matrix though. Hopefully that clarifies things.
[This message has been edited by harsman (edited 01-22-2001).]