Filling an area inside an irregularly shaped polygon in opengl es

I have a set of points that describe my polygon. A polygon can have many different shapes, including convex shapes (imagine a crescent shape). I thought I could fill the inside of these shapes using a triangle fan that started at the first point around the perimeter, but that's not so bad on certain shapes.

How do people do it? I want glPaintBucket function.

+2


source to share


1 answer


I believe you need to use the (inline) triangle primitive after splitting your polygon into triangles (start here to learn about polygon triangulation).



+3


source







All Articles