1) Supplying OpenGL with matrices is usually done in 2 steps. The projection is set-up usually like here:
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(camera->projection());
It is often done once, since most application need not change the projection afterwards. The model-view matrix is composed from the view matrix and the model matrices, and often varies from frame to frame, so it is set-up each time at the beginning of the rendering loop:
glMatrixMode(GL_MODELVIEW);
glLoadMatrix(camera->view());
glPushMatrix();
glMultMatrix(someModel->worldFrame());
glPopMatrix();
where the latter 3 lines are repeated for each model that is rendred (it may be more complex, e.g. if deeper frame nesting is used).
2) Mathematically OpenGL uses column vectors with the homogeneous component at the 4th place. A matrix looks like:
[ Rxx Ryx Rzx Tx ][ Rxy Ryy Rzy Ty ][ Rxz Ryz Rzz Ty ][ 0 0 0 1 ]
what can be interpreted as [Rxx Rxy Rxz]t denoting the x direction vector, [Ryx Ryy Ryz]t denoting the y direction vector, [Rzx Rzy Rzz]t denoting the z direction vector, and [Tx Ty Tz]t denoting the position. (Here the super-posed t denotes the transpose operator, since I wrote the column vectors as rows; its just for a convenient writing.)
Such a 2D construct has to be mapped to the 1D (linear) computer memory. OpenGL uses the column major order, what means that it walks down a column before it goes to the next one. In summary that means a layout like
Rxx Rxy Rxz 0 Ryx Ryy Ryz 0 Rzx Rzy Rzz 0 Tx Ty Tz 1
Now, if you remember back, D3D uses row vectors as well as row-major order. Notice please that both kinds of handling are changed! That means that the same matrix as above has to be transposed to yield in the mathematical representation:
[ Rxx Rxy Rxz 0 ][ Rxy Ryy Ryz 0 ][ Rzx Rzy Rzz 0 ][ Tx Ty Tz 1 ]
When mapping this in row major order to a linear memory, you'll get
Rxx Rxy Rxz 0 Ryx Ryy Ryz 0 Rzx Rzy Rzz 0 Tx Ty Tz 1
what is unsurprisingly the same as with OpenGL. I write "unsurprisingly" because both the vector kind as well as the order kind are changed so that both changes annul each other.
Hence, it is senseful to use the above layout. Notice please that this is nevertheless not the only possible layout. E.g. Collada uses an incompatible layout.
I hope that has cleared the issue.
EDIT: 2 syntax errors corrected.
[Edited by - haegarr on November 24, 2008 6:07:56 AM]