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 4 of 4

Thread: Hide surfaces

  1. #1
    Intern Newbie
    Join Date
    Mar 2002
    Location
    Hermoupolis
    Posts
    33

    Hide surfaces

    Hi all, I want to know how hide the surfaces that are further back in the plane, but are drawn last in the window! Thanks
    SeeDAreW

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,633

    Re: Hide surfaces

    Use depth buffering.

    glDepthFunc(GL_LEQUAL);
    glEnable(GL_DEPTH_TEST);

    Alrighty?

  3. #3
    Intern Newbie
    Join Date
    Mar 2002
    Location
    Hermoupolis
    Posts
    33

    Re: Hide surfaces

    Thanx I'll try it!!
    Originally posted by zeckensack:
    Use depth buffering.

    glDepthFunc(GL_LEQUAL);
    glEnable(GL_DEPTH_TEST);

    Alrighty?
    SeeDAreW

  4. #4
    Member Regular Contributor
    Join Date
    May 2000
    Location
    Oxford, England
    Posts
    471

    Re: Hide surfaces

    dont forget to clear the depth buffer each frame & initialise the depth buffer at start up.

    ie, glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);

    &

    glutInitDisplayMode(GLUT_RGB|GLUT_DEPTH|GLUT_DOUBL E);

Posting Permissions

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