PDA

View Full Version : edges problem



05-31-2000, 11:16 PM
Hi!
I'm beginner in opengl.
How can I draw a rectangle with its black edges and fill with red color?
or another primitive like disk or partial disk?
or how can i draw a red cube with its black edges?
I try to use glflagedges and glpolygonMode but i can't view correctly
the edges?
i need some example, please!

thanks

Pauly
06-01-2000, 03:00 AM
You really need to draw it twice, once with



glPolygonMode ( GL_FRONT_AND_BACK, GL_FILL );

to draw your filled red cube.

And then


glPolygonMode ( GL_FRONT_AND_BACK, GL_LINES );

to draw your cube in wireframe, you'll have to set the drawing colour to black...

Read up on PolygonOffset to, that could come in handy.

Paul Groves
pauls opengl page (http://home.clara.net/paulyg/ogl.htm)
paul's opengl message board (http://paulyg.virtualave.net/cgi-bin/Ultimate.cgi?action=intro)

06-01-2000, 03:07 AM
And this work fine with flat (2D) nurbs surface?