PDA

View Full Version : order of objects (layers)



25maxi25maxi25
09-20-2004, 05:53 AM
Hello
I want implement something like layers. e.g objects should painted in planes (different z values) ... but it does not work - the order of objects is always like the painting order independ of the z-value (between 1 and -1 - I use Ortho2D mode).

Whats wrong ? how must i configure opengl ?

Thanks
martin

chowe6685
09-20-2004, 07:57 AM
glEnable(GL_DEPTH_TEST);

squall
09-20-2004, 09:30 AM
Just glEnable(GL_DEPTH_TEST) ???? :confused:
can he use Zbuffer with gluOrtho2D ??? :confused:

dorbie
09-20-2004, 09:42 AM
Yes the zbuffer will work with ortho2D and enabling it is about all you need to do.

He should also make sure that he has a depth buffer requested in the visual or PFD but he probably does even without trying, it should not be relied upon though, it should be explicitly requested.

Other settings like depth test have sensible settings without messing with them, although IMHO you should at least touch these calls so you know what you're doing.

squall
09-20-2004, 10:20 AM
requested in the visual or PFD you mean in the window setting ??

25maxi25maxi25
09-20-2004, 10:23 PM
Thanks for your help.