开发者

OpenGL ES - Draw Triangle with line only?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜