[ODE] OT: geometic solids and hidden line removal

Don Burns don at andesengineering.com
Sat May 1 15:27:48 MST 2004



On Sat, 1 May 2004, Martin C. Martin wrote:

> 
> 2. Does anyone have a good reference on how to draw wireframe drawings 
> with hidden surface removal?

Hi Martin,

If you set the OpenGL state attribute glPolygonMode( GL_FRONT_AND_BACK, 
GL_LINE), your normally filled polygons will be drawn as wire frame.  If 
you combine this state with glEnable( GL_CULL_FACE ), backfacing polygons 
will be culled, even if they are drawn as wireframe.

This only partially solves your problem as it is limited to convex objects 
but might be sufficient for your needs.

If you need full occlusion, there are multiple approaches to doing this, 
depending on what you are actually trying to accomplish.  One approach is 
to draw your object "scribed".  That is, draw it as filled polygons first, 
then draw it again, with these states enabled:

    glPolygonMode( GL_GL_FRONT_AND_BACK, GL_LINE );
    glEnable( GL_CULL_FACE );
    glPolygonOffset( -1.0, -1.0 );


Cheers,

-don



More information about the ODE mailing list