So I’m trying to draw a shape using a matrix that I define. I do this
glMatrixMode(GL_MODELVIEW);
float m[16] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2};
glPushMatrix();
glLoadMatrixf(m);
It is my understanding that the current matrix should now be all 2’s. However, when I use the following code to check the current matrix, it returns the identity matrix.
glGetFloatv (GL_MODELVIEW_MATRIX, m1);
After this code runs, m1 SHOULD contain all 2’s, but instead it is the identity matrix, just as it is before I call glLoadMatrixf (I run that last line in a few places to see what the current matrix is). Can anyone see what I’m doing wrong?
I am able to draw a scene fine if I use a scene graph, or use the rotate, scale, transform functions on a matrix, but the load matrix method doesn’t seem to do anything.
For the specific job I’m working on, I need to be able to load custom matrices, not just manipulate them by rotating, scaling, translating. Any help would be welcome. Thanks.