1

On the right is the shape generated by GL_LINE_STRIP and on the left is it generated by GL_POLYGON.

enter image description here There's a function which generates each point 1 by 1 in order.

Why is there such a big difference in the basic shape? Notice how less 'curved' each portion of the cloud is in the GL_POLYGON version.

Any clue how to fix this? Or maybe use something else to fill this polygon I have?

genpfault
  • 49,394
  • 10
  • 79
  • 128
user1265125
  • 2,526
  • 7
  • 39
  • 64

2 Answers2

2

GL_POLYGON is only for convex polygons:

GL_POLYGON: Draws a single, convex polygon. Vertices 1 through N define this polygon.

You'll have to triangulate your polygon and use GL_TRIANGLES instead.

Or abuse the stencil buffer.

Community
  • 1
  • 1
genpfault
  • 49,394
  • 10
  • 79
  • 128
0

Or you could "shade" the fragments inside of the polygon. Just like a polygon filling algorithm