Hide surfaces

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

Use depth buffering.

glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);

Alrighty?

Thanx I’ll try it!!

Originally posted by zeckensack:
[b]Use depth buffering.

glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);

Alrighty?[/b]

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_DOUBLE);