12-26-2003, 10:34 AM
Hello,
I wrote a programm with a few triangles rotating around a point. I want hidden triangles(trinagles which are obscured by triangles in front of them) to be removed. I tried to use the depth buffer to do this, but when I enable
GL_DEPTH_TEST, my triangles all start to flicker and the screen output looks rather strange. My code looks something like that(I am using glut):
//Start of Pseudo-Code
glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE|GLUT_DEPT H);
//...
glEnable(GL_DEPTH_TEST);
//...
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
Draw_the_triangles();
glutSwapBuffers();
//End of Pseudo-Code
I hope anyone can help.
Thanks,
Martin
I wrote a programm with a few triangles rotating around a point. I want hidden triangles(trinagles which are obscured by triangles in front of them) to be removed. I tried to use the depth buffer to do this, but when I enable
GL_DEPTH_TEST, my triangles all start to flicker and the screen output looks rather strange. My code looks something like that(I am using glut):
//Start of Pseudo-Code
glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE|GLUT_DEPT H);
//...
glEnable(GL_DEPTH_TEST);
//...
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
Draw_the_triangles();
glutSwapBuffers();
//End of Pseudo-Code
I hope anyone can help.
Thanks,
Martin