OpenGL depth buffer problem??????

Started by
2 comments, last by glJunkie 21 years, 4 months ago
Hi. This is killing me, i just cant get it to work. Im trying to draw a spinning pyramid in opengl. but some of its faces are visible that shouldnt be, like stuff that should be behind is being drawn infront. Is it something to do with the depth buffers? This is ths depth buffer code: glClearDepth(1.0f); // Depth Buffer Setup glEnable(GL_DEPTH_TEST);// Enables Depth Testing glDepthFunc(GL_LEQUAL);// The Type Of Depth Testing To Do I hope someeone can help me. Thanks, Tim.
Advertisement
You need to turn on backface culling.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
Actually, he needs to push his near plane out. And stop posting OpenGL questions in here.
gluPerspective (60, width/height, 0, 1000)

If you have something like this, change the 3rd value to 1 or more. A near plane of 0(or 0.1 or less) usually gives you problems.

This topic is closed to new replies.

Advertisement