PDA

View Full Version : Hide surfaces



SeeDAreW
03-01-2002, 01:54 AM
Hi all, I want to know how hide the surfaces that are further back in the plane, but are drawn last in the window! Thanks

zeckensack
03-01-2002, 01:56 AM
Use depth buffering.

glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);

Alrighty?

SeeDAreW
03-01-2002, 01:57 AM
Thanx I'll try it!!

Originally posted by zeckensack:
Use depth buffering.

glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);

Alrighty?

Rob The Bloke
03-02-2002, 04:51 PM
dont forget to clear the depth buffer each frame & initialise the depth buffer at start up.

ie, glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);

&

glutInitDisplayMode(GLUT_RGB|GLUT_DEPTH|GLUT_DOUBL E);