View Full Version : Drawing Triangles That are outlined and filled
07-06-2004, 05:58 AM
Does anyone know of way to draw triangles in GL so that it is outlined in one color and filled in another?
07-06-2004, 06:42 AM
There must be a better way to do it, but here's one:
first draw your triangle using glPolygonMode(GL_FRONT_AND_BACK,GL_FILL) and use your desired color.
then draw the triangle again using glPolygonMode(GL_FRONT_AND_BACK,GL_LINES) using your outline color.
07-06-2004, 06:59 AM
That's the correct OpenGL way to do it.
The line mode is GL_LINE! GL_LINES is used elsewhere.
Lookup glPolygonOffset to find how you can avoid depth buffering artifacts of the lines in this case.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.