Reputation: 1015
Is there a way to draw a triangle with line only ? I think GL_TRIANGLES option make triangle filled with color.
Upvotes: 7
Views: 16552
Reputation: 873
if you are only rendering a single triangle at a time you can use GL_LINE_LOOP
. it will connect the first and last, so if you have more than one triangle, it won't work.
Upvotes: 0
Reputation: 26925
Is there a way to draw a triangle with line only?
Use GL_LINES
, GL_LINE_STRIP
, or GL_LINE_LOOP
(difference see here) with the same vertices that you use for GL_TRIANGLES
.
Upvotes: 1
Reputation: 5708
Set the fill mode with glPolygonMode(face, model):
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
You have to set this every frame
Upvotes: 17