hidden line removal

Hi All,
I am drawing 3D graph which shows too many number of lines. I want to remove the hidden lines. Can any one tell me how to do that.

It is a bit messy to do true hidden line removal with OpenGL, but a quick solution could be do render the polygons as filled polygons first and then render them again as outlines with a little zoffset.

This only works as long as it doesn’t overlap any other objects of course.

And it does not work with concave polygons either by the way.


Thanks for the reply.
Can I get some sample which does the same?
So that i cud have got an idea of what way its doing and can try implementing with additions what ever.
Thanks again

Check out the OpenGL Programming Guide (Red Book). There is an example of this process with source.

If you have the latest (fourth edition) then it is Chapter 14, page 604-605: Hidden Line Removal with Polygon Offset.

If you don’t have the book, you may find the chapter online with a brief Internet search.

The trick is experimenting with the offset values.

Can you tell me where I can find the code for the true hidden line removal with OpenGL?


Check out the FAQ