View Full Version : How to hide the backside of the GL_LINE

06-16-2010, 04:27 PM
I am drawing one surface on the current scene. Then on the suface, I draw a line with normal the same as the surface but different color. Then I rotate the two targets at the same time. I used

So when the surface is rotating, it only shows me the front face. However, the line is still there when it rotated to the far side with a black line. I am wondering how to hide this line when it is rotating away with its back side. I think the depth buffer will handle this if there is something infront of the line. But it is not working in my case.
Thank you very much,

07-13-2010, 03:56 PM
GL lines don't have front and back faces. You would need to either cull the lines yourself in the CPU or tesselate them (i.e. transform them into polygons).

07-13-2010, 04:17 PM
Thanks. That is what I did later on to solve this problem.