OpenGL depth buffer problem??????
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.
You need to turn on backface culling.
Death of one is a tragedy, death of a million is just a statistic.
Death of one is a tragedy, death of a million is just a statistic.
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.
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
Popular Topics
Advertisement