PDA

View Full Version : color of polygon and his outline



pato
04-09-2002, 06:59 AM
I want to draw a polygon which is red (for example) with outline black.

other problem :
the last object I draw is in foreground and the 3D isn't respected.
I draw a repere(for viewing physic experience) and a graphic(polygons) with two display list.

[This message has been edited by pato (edited 04-09-2002).]

Bob
04-09-2002, 07:06 AM
Since your post didn't include a question, I will assume you meant to ask how to do it.

You have to draw your objects in two passes. One for the filled area, and one for the outlines. Have a look in the OpenGL FAQ for information on polygon offset, which is good if you want to avoid Z-fighting in the second pass. There are some usefull code there too.

Furrage
04-10-2002, 09:03 AM
Originally posted by pato:
I want to draw a polygon which is red (for example) with outline black.
Draw the polygon first, then repeat the drawing using glBegin(GL_LINE_STRIP) to draw the border.


Originally posted by pato:
other problem :
the last object I draw is in foreground and the 3D isn't respected.
Could be z fighting. Or it may be that you have not enabling depth buffering. In the latter case the last item is always drawn over the item before it.