0
我正在使用openGL/GLUT試圖繪製一個圖元並使用gluLookAt()移動相機。有麻煩,我只是看到黑色。這是我的渲染函數的代碼。gluLook沒有任何東西出現
glMatrixMode(GL_MODELVIEW);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
gluLookAt(Player.GetX(), Player.GetY(), Player.GetZ()-5,
Player.GetX(), Player.GetY(), Player.GetZ(),
0,1,0);
glPushMatrix();
glBegin(GL_TRIANGLES); //Begin coordinates
glVertex3f(Player.GetX()-0.5f, Player.GetY()-1.0f, Player.GetZ());
glVertex3f(Player.GetX()+0.5f, Player.GetY()-1.0f, Player.GetZ());
glVertex3f(Player.GetX()-0.0f, Player.GetY()-0.0f, Player.GetZ());
glEnd(); //End quadrilateral coordinates
glPopMatrix();
glutSwapBuffers();
的Player.GetXYZ()值都是0.0
一旦你解決了這個問題,請你幫個忙,直接轉到OpenGL 3.0+。 [這是爲什麼](http://stackoverflow.com/questions/3492729/whats-so-different-about-opengl-3x)。 [這裏是如何](http://stackoverflow.com/questions/9293817/resources-to-learn-opengl-3-x)。 – Domi
看起來你的眼睛超出了你的三角形。嘗試第3次參數中的+5。 – bvj
是啊剛得到那個:/謝謝!好的,所以我會嘗試轉換爲OpenGL 3.0之前我太深謝謝你的幫助。 –