PDA

View Full Version : Depth buffer problem ?



Vlasko
03-05-2003, 10:38 AM
1.)I have a really simple program displaing 2 triangles but it won't display them if the z-coordinates are higher than 0 even when I set depth buffer

glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);

Where is the problem ?

2.)How can I set the screen coordinates ? I don't want to use floating point numbers frequently(-1,1,-1,1,-1,1).glOrtho doesn't seem to work

HalcyonBlaze
03-05-2003, 06:41 PM
1) You seem to be setting the perspective up wrong. I can't say for sure without more code.

2) I belive you want the gluUnproject(...) procedure.

- Halcyon

M/\dm/\n
03-06-2003, 02:32 AM
Use negative values of z to move objects further to front, you wont see positive values (with Projection) there is a different story with Ortho though. Anyway nehe.gamedev.net

Vlasko
03-08-2003, 07:17 AM
As I know 0 on z axis should be displayed(and it is)but in case the object is not rotated then it is shown only once then disappers whats wrong with that ?