OpenGL Wierd **** - Order of Drawing Stuff?
I am trying to figure out some wierd ****.
I have an object I defined as a cube which is for quadrilaterals as the faces,I couldn't figure out a cleverway to make it use a quad_strip with the vertices. Whatever. So, then I have a draw routine for it.
And it does some wierd stuff. Dude! Like, so the thing is all rotating around n stuff. And then it seems like when some face is facing us, it may be drawn earlier than the one that is the back face, and then the backfaceappears to be the front. It's kind of hard to describe, it looks like that wierd figure-ground illusion with the wire cube with things jumping to the front and all. Here's a screenshot of it. http://img.photobucket.com/albums/v2...untitled-1.jpg I want to figure out how to make it just look like a solid cube instead of sometimes being able to 'see through it' or the illusion of that because things are drawn in front. Or, that'smy wierd hypothesis. Any ideas?
glTranslatef(0.0f, 0.0f, -0.2f);
glRotatef(rotate / 2, 0, 1, 0);
glRotatef(rotate, 1, 0, 0);
for(int i = 0; i < 6; ++i)
glColor3f(colors[i].x, colors[i].y, colors[i].z);
for(int k = 0; k < 4; ++k)
glVertex3f(faces[i][k].x, faces[i][k].y, faces[i][k].z);