Results 1 to 6 of 6

Thread: order of objects (layers)

  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
    Senior Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Princeton, NJ
    Posts
    380

    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 imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    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.

Similar Threads

  1. Displaying and transforming objects in layers
    By blessman11 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-04-2011, 08:13 PM
  2. order of objects in scene
    By Hystaspes in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 09-07-2010, 05:34 AM
  3. separate the objects in layers
    By Xemame in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 03-17-2010, 01:16 PM
  4. Masking (and the order of rendering objects)
    By BlinX in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-27-2004, 12:49 PM
  5. Order of 2d objects in OpenGL
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-19-2003, 08:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean