OpenGL GL_POLYGON concave polygon doesn't color in

前端 未结 1 486
长情又很酷
长情又很酷 2020-12-02 02:05

I have a problem when I try to use Polygon in OpenGL. I don\'t know how to explain this but all my vertices are connected with the beginning one. The problem happens when I

相关标签:
1条回答
  • 2020-12-02 02:34

    GL_POLYGON is only for convex polygons.

    For concave polygons you have at least two options:

    1. Triangulate the polygon and use GL_TRIANGLES.

    2. Use the stencil buffer trick.

    0 讨论(0)
提交回复
热议问题