起初我有一個簡單的白色矩形棱柱這樣的:重繪glQuads - OpenGL的
下面的代碼:
glBegin(GL_QUADS);
glColor3f(255,255,255);
glVertex3f(0.3, 0, 2.5);//sisi bawah
glVertex3f(0.5, 0, 2.5);
glVertex3f(0.5, 0, 2.6);
glVertex3f(0.3, 0, 2.6);
glVertex3f(0.5, 0, 2.6);//sisi kiri
glVertex3f(0.3, 0, 2.6);
glVertex3f(0.3, 1.5, 2.6);
glVertex3f(0.5, 1.5, 2.6);
glVertex3f(0.5, 0, 2.5);//sisi depan
glVertex3f(0.5, 0, 2.6);
glVertex3f(0.5, 1.5, 2.6);
glVertex3f(0.5, 1.5, 2.5);
glVertex3f(0.3, 0, 2.5);//sisi belakang
glVertex3f(0.3, 0, 2.6);
glVertex3f(0.3, 1.5, 2.6);
glVertex3f(0.3, 1.5, 2.5);
glVertex3f(0.3, 1.5, 2.5);//sisi atas
glVertex3f(0.5, 1.5, 2.5);
glVertex3f(0.5, 1.5, 2.6);
glVertex3f(0.3, 1.5, 2.6);
glVertex3f(0.5, 0, 2.5);//sisi kanan
glVertex3f(0.3, 0, 2.5);
glVertex3f(0.3, 1.5, 2.5);
glVertex3f(0.5, 1.5, 2.5);
glEnd();
然後,我想提請另一個像這樣的矩形棱鏡:
只需使用glTranslate
就可以重新繪製另一個棱鏡,因此我不必手動插入數字?
簡單的答案是「是」 – benjymous
爲什麼你們所有人仍然使用即時模式? – Drop
@Drop是的,我讓人傷心看到人們使用已棄用的功能。 – Vallentin