i'm completely don't understanding opengl+glut works.... PLEASE explain why he does that? =(
I have simple code
void display() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); ChessboardSurrogate.Draw(6,8,50, 0,0); // draw chessboard(6x8) in (0,0,0) edge per cell 50 glPopMatrix(); glPushMatrix(); //glutSolidCube(100); //!!!!! glPopMatrix(); glLoadIdentity(); gluLookAt( 0.0, 0.0, -testSet::znear*2, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); glMultMatrixf(_data->m); // my transformation matrix glutSwapBuffers(); }
And i get the expected result. screenshot #1
Then I uncomment glutSolidCube(100). In any case, I even do push/pop current matrix, and later override it by identity matrix.... i think that i would see the same result image with cude... BUT! i see THIS screenshot #2 What the..... &*^@#$% Why?
If i add code
glRotatef(angleX,1.0,0.0,0.0); glRotatef(angleY,0.0,1.0,0.0);
before glutSwapBuffers, than I'll see that the chessboard on the spot ..... screenshot #3