For some reason, whenever I try to make a quad with OpenGL, it always has a clear triangle in it. I included a picture that show an example of it.
For some reason, whenever I try to make a quad with OpenGL, it always has a clear triangle in it. I included a picture that show an example of it.
Code please.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Code:void Render(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); glTranslatef(-1.0f, -1.0f, 0.0f); glRotatef(SpinX, 1.0, 0.0, 0.0); glRotatef(SpinY, 0.0, 1.0, 0.0); glRotatef(SpinZ, 0.0, 0.0, 1.0); glBegin(GL_TRIANGLES); glColor3f(1.0f, 1.0f, 1.0f); glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f(0.0f, 2.0f, 0.0f); glVertex3f(2.0f, 0.0f, 0.0f); glColor3f(1.0f, 0.0f, 0.0f); glVertex3f(0.0f, 0.0f, 3.0f); glVertex3f(0.0f, 2.0f, 3.0f); glVertex3f(2.0f, 0.0f, 3.0f); glEnd(); glBegin(GL_QUADS); glColor3f(0.0f, 1.0f, 0.0f); glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f(0.0f, 0.0f, 3.0f); glVertex3f(2.0f, 0.0f, 0.0f); glVertex3f(2.0f, 0.0f, 3.0f); glEnd(); glPopMatrix(); glutSwapBuffers(); }
Just looking at that picture... it looks like a shadow.
Away.
it's not, because if you rotate the image you can see right through it
you are drawing the vertices in the wrong order...
edit: ascii artCode:you are doing this... 1----2 / / / 3----4 you need to do this 4--3 | | 1--2
Last edited by Perspective; 07-04-2003 at 11:53 PM.
or turn off culling