PDA

View Full Version : Hidden line usage in OpenGL?



GLBenner
06-13-2014, 01:54 PM
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]

Osbios
06-13-2014, 02:00 PM
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 .

GLBenner
06-14-2014, 08:00 AM
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]