Is there a way to draw a triangle with line only ? I think GL_开发者_运维知识库TRIANGLES option make triangle filled with color.
Set the fill mode with glPolygonMode(face, model):
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
You have to set this every frame
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
.
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.
精彩评论