this code
void printMat(const char* l) {
float mat[16] = { 0, };
glGetFloatv(GL_MODELVIEW_MATRIX, mat);
printf("%s\n", l);
printf("%f %f %f %f\n", mat[0], mat[1], mat[2], mat[3]);
printf("%f %f %f %f\n", mat[4], mat[5], mat[6], mat[7]);
printf("%f %f %f %f\n", mat[8], mat[9], mat[10], mat[11]);
printf("%f %f %f %f\n", mat[12], mat[13], mat[14], mat[15]);
}
...
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
printMat("--before--");
glTranslatef(1.0f, 2.0f, 3.0f);
printMat("--trans--");
prints this
--before--
1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.000000 0.000000 0.000000 1.000000
--trans--
1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
1.000000 2.000000 3.000000 1.000000
Showing that the storage format of matrices in GL is
xAxis.x, xAxis.y, xAxis.z, 0,
yAxis.x, yAxis.y, yAxis.z, 0,
zAxis.x, zAxis.y, zAxis.z, 0,
translation.x, translation.y, translation.z, 1