Skip to main content
gamedev.net
🔒 Locked

Depth problems

Started by rotos Dec 13, 2002 at 7:12 PM 1 replies 450+ views
Original Post
rotos
rotos
I'm having a problem with depth testing with SDL/Linux. The problem is that whenever I try to draw something with a depth greater than 1.0, it gets clipped, despite the call to glFrustum setting the far plane, and a call to disable depth testing. Does anybody know anything I might have forgotten to do? Thanks. A short summary of the OpenGL state that doesn't work.
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-4.5, 4.5, 4.5, -4.5, .5, 5000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glDisable(GL_DEPTH_TEST);

glBegin(GL_QUADS);

glVertex3f(0, 0, 2);
glVertex3f(0, 1, 2);
glVertex3f(1, 1, 2);
glVertex3f(1, 0, 2);

glEnd();
 
[edited by - rotos on December 13, 2002 8:12:52 PM]
Null and Void
Null and Void
The Z-Axis gets more negative as it goes into the screen in OpenGL. Replace the ''2'' as the third parameter in glVertex3f with ''-2.0f'' and see what happens.

rotos
rotos
Ahh, I see. Thank you.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.