PDA

View Full Version : Solid Geometry



Thanh Son
07-18-2002, 10:07 PM
Hi
I want to draw objects of solid geometry like tetrahedron, cube...
I want to draw the line which can't be seen as DOT_STYLE (like objects are drawn in school-book) and when I rotate the object this line will be redraw, if It's can be seen it will drawn in normal style, and the others can't be seen will be in DOT_STYLE
How can't I do that or is there any library suport it and how to use it?.
Thanks!

Rob The Bloke
07-19-2002, 12:11 AM
Look for line stipple

Thanh Son
07-19-2002, 01:23 AM
Thanks
when I write
glPolygonMode(GL_FRONT , GL_LINE);
glEnable(GL_LINE_STIPPLE);
glLineStipple(3,3);
glPolygonMode(GL_BACK , GL_LINE);
It change all poygon's line but I only want it change back-face

tc
07-19-2002, 02:08 AM
You can do several pass:

glEnable( GL_CULL_FACE );
glEnable( GL_POLYGON_OFFSET_FILL );
glPolygonOffset( 1.0F, 1.0F );
// ... Draw Faces ...
glDisable( GL_POLYGON_OFFSET_FILL );

glDisable( GL_CULL_FACE );
glDisable( GL_DEPTH_TEST );
glLineWidth( 0.9F );
glEnable( GL_LINE_STIPPLE );
glLineStipple( 1, 0x0F0F );
glColor3f( 0.3F, 0.3F, 0.3F );
// ... Draw Edges ...
glDisable( GL_LINE_STIPPLE );
glEnable( GL_DEPTH_TEST );

glEnable( GL_CULL_FACE );
glDepthFunc( GL_LEQUAL );
glDepthMask( GL_FALSE );
glLineWidth( 1.0F );
glColor3f( 0, 0, 0 );
// ... Draw Edges ...
glDepthFunc( GL_LESS );
glDepthMask( GL_TRUE );
glDisable( GL_CULL_FACE );


Hope this helps you,
Thomas.