I’ve used the glGetDoublev function to get the modelview matrix but the function returns me an array with every value set to 0. I tried also to get the porjection matrix and get the same result. Here’s a function that calls glGetDoublev before a call of gluLookAt and after that call. Both calls of glGetDoublev returns this result:
void setModelview(void)
{
GLdouble temp[16];
// setup model matrix
glGetDoublev(GL_MODELVIEW_MATRIX, temp); // get modelview-matrix
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0.0, 0.0, 100.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
glGetDoublev(GL_MODELVIEW_MATRIX, temp); // get modelview-matrix
}
I’ve no more ideas why this happens…
I’ve noticed the failure occurs ONLY when I call glGetDoublev with parameter GL_MODELVIEW_MATRIX and NOT with parameter GL_PROJECTION_MATRIX.