-1
我完全不理解opengl + glut工作.... 請解釋他爲什麼這麼做? =(OpenGL和GLUT uncomprehension
我有簡單的代碼
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(); }
,我得到預期的結果。screenshot #1
然後我去掉glutSolidCube(100)。在任何情況下,我甚至推/彈出電流矩陣,後來重寫它的身份矩陣 ....我認爲,我會看到與cude相同的結果圖像... 但是!我看THIS screenshot #2什麼..... & *^@#$ %W HY?
如果我添加代碼
glRotatef(angleX,1.0,0.0,0.0); glRotatef(angleY,0.0,1.0,0.0);
glutSwapBuffers前,比我會看到當場棋盤..... screenshot #3