tags:

views:

403

answers:

1

I have a set of points that outlines my polygon. The polygon can have many different shapes including convex shapes (imagine the shape of a crescent moon). I thought I could fill the inside of these shapes by using a triangle fan that started at the first point on the perimeter, but this fails badly on certain shapes.

How do people get this done? I wish there was a glPaintBucket function.

+2  A: 

I believe you need to use the (intrinsically filled) triangle primitive after breaking up your polygon into triangles (start here to learn about polygon triangulation).

Alex Martelli