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

Thread: Hidden line usage in OpenGL?

  1. #1
    Newbie Newbie
    Join Date
    Jun 2014
    Posts
    2

    Hidden line usage in OpenGL?

    I'm new to OpenGL and want to create a textured 3D maze like you would see in a first person game like 'Eye of the Beholder'. I have the 3D maze rendering in a window, but when I have one wall in front of another, I can sometimes see through to parts of the wall behind. I'm assuming OpenGL has an easy way to do the hidden object removal for you? Do I use GLEnable to turn on this feature, or how is it done?

    I'm using the TAO framework for my OpenGL work.

    I've attached an image of a portion of my maze so you can see the effect I am talking about.

    Thanks

    [Tim]
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	maze.jpg 
Views:	52 
Size:	90.7 KB 
ID:	1341  

  2. #2
    Intern Contributor
    Join Date
    May 2013
    Posts
    60
    Yes there is. Its called z-buffer or in OpenGL depth buffer

    Here for basic understanding: http://en.wikipedia.org/wiki/Z-buffering
    And here about the OpenGL variant: http://www.opengl.org/wiki/Depth_Test

    You also can find a lot of tutorials about it just with the search terms depth buffer and OpenGL .

  3. #3
    Newbie Newbie
    Join Date
    Jun 2014
    Posts
    2
    Quote Originally Posted by Osbios View Post
    Yes there is. Its called z-buffer or in OpenGL depth buffer


    You also can find a lot of tutorials about it just with the search terms depth buffer and OpenGL .
    Thanks for the reply. I was able to use the links you provided to get the depth buffering to work. At first I was presented with a blank screen, then I realized that the near clipping plane was set to 0. Once I fixed that, everything worked fine.

    [Tim]

Posting Permissions

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