Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: order of objects (layers)

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    6

    order of objects (layers)

    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

  2. #2
    Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Princeton, NJ
    Posts
    391

    Re: order of objects (layers)

    glEnable(GL_DEPTH_TEST);

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    7

    Re: order of objects (layers)

    Just glEnable(GL_DEPTH_TEST) ????
    can he use Zbuffer with gluOrtho2D ???

  4. #4
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: order of objects (layers)

    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.

  5. #5
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    7

    Re: order of objects (layers)

    requested in the visual or PFD
    you mean in the window setting ??

  6. #6
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    6

    Re: order of objects (layers)

    Thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •