hexa
#1
Hi

I’m looking for example of drawing concave polygons (in FILL mode).

Of course one of the solutions is to divide the original polygon in triangles, but is there any OpenGL alternative?

I heard it can be done with the stencil buffer. Is there any sample code?

Thanks in andvance

OpenGL redbook describes very well about drawing concave polygon using stencil buffer.

Here is my example using stencil buffer, drawing 3 non-convex polygons;

- simple concave quad.
- a polygon with a hole in it.
- self intersected polygon.

It works #1 and #2 cases except #3.

stencilTess.zip

Also, check out OpenGL Tessellator , too.

hexa
#3
Thanks a lot

(How simply it was! )