Original Post
Anyway I am having a problem with polygon gaps in my rotating Octahedron program. Everytime it rotates there is a certain gap between one of the polygons. Anyway here is the source code with the problem if anyone can help me out I would greatly appreciate it. NOTE: I think it has something to do with polygon orientation but I'm a bit confused on this area of openGL. void Diamond_Display() { glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); static GLfloat vertexes[6][3] = { {0.0, 1.0, 0.0},{ 1.0, 0.0, 0.0},{ 0.0, 0.0, 1.0}, {0.0,-1.0, 0.0},{-1.0, 0.0, 0.0},{ 0.0, 0.0,-1.0}}; static GLfloat vertexes2[6][3] = { {0.0, 1.0, 0.0},{ X1, 0.0, X1},{ X1, 0.0,-X1}, {0.0,-1.0, 0.0},{-X1, 0.0,-X1},{-X1, 0.0, X1}}; static GLuint tindices[8][3] = {{0, 5, 1},{0, 5, 4},{0, 4, 2},{0, 1, 2}, {3, 5, 1},{3, 5, 4},{3, 4, 2},{3, 1, 2}}; int triangle; glPushMatrix(); glRotatef(spin, 0.0, 1.0, 0.0); glBegin(GL_TRIANGLES); for(int i = 0; i < 8; ++i) { /*subdivide(&vertexes[tindices[0]][0], &vertexes[tindices[1]][0], &vertexes[tindices[2]][0]);*/ glColor3f(1.0, 0.0, 0.0); glVertex3fv(&vertexes[tindices[0]][0]); glColor3f(0.0, 1.0, 0.0); glVertex3fv(&vertexes[tindices[1]][0]); glColor3f(0.0, 0.0, 1.0); glVertex3fv(&vertexes[tindices[2]][0]); } glEnd(); glPopMatrix(); }