[英]QT OpenGL not fully rendering cube?
我正在嘗試創建和顯示一個 3D 正方形,但由於某種原因,當我渲染它時,它的一部分丟失了:
void DrawCube::drawCubes(int amount){
glBegin(GL_POLYGON);
glVertex3f( 1.0, -1.0, 1);
glVertex3f( 1.0, -1.0, -1);
glVertex3f( 1.0, 1.0, -1);
glVertex3f( 1.0, 1.0, 1);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-1.0, -1.0, -1);
glVertex3f( 1.0, -1.0, -1);
glVertex3f( 1.0, 1.0, -1);
glVertex3f(-1.0, 1.0, -1);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-1.0, -1.0, 1);
glVertex3f( 1.0, -1.0, 1);
glVertex3f( 1.0, 1.0, 1);
glVertex3f(-1.0, 1.0, 1);
glEnd();
glBegin(GL_POLYGON);
glVertex3f( -1.0, -1.0, 1);
glVertex3f( -1.0, -1.0, -1);
glVertex3f( -1.0, 1.0, -1);
glVertex3f( -1.0, 1.0, 1);
glEnd();
}
}
我不是在尋找只給我代碼的答案,而是對導致此感謝的原因的解釋。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.