开发者

OpenGL ES - Draw Triangle with line only?

开发者 https://www.devze.com 2023-03-19 17:55 出处:网络
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):

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

精彩评论

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

关注公众号