Archived

This topic is now archived and is closed to further replies.

dannyxyz23

Depth doesn't seem to work

Recommended Posts

Hallo leute, I''m trying to make a 3d world in openGL, but as I add new rooms to the game, they seem to be all messed up (one comes in front of the other). Better saying, they seem to be ok, but as soon as I walk ahead, they seem to collapse one into another. I''m drawing the walls one over the other, could that be a problem? (ex: the wall1 (w1) is drawed twice, one for room1 and again for room 2) ------w1-------- |room1 |room2 | | ------w1-------- My gldepth config are the following: unsigned int mode = GLUT_DEPTH | GLUT_RGBA | GLUT_DOUBLE; glutInitDisplayMode(mode); glClearDepth(1.0f); glDepthFunc(GL_LESS); glEnable(GL_DEPTH_TEST); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); Thanks in advance

Share this post


Link to post
Share on other sites