createPoly() is broken for concave polygons!
-
When drawing a filled concave polygon with creatPoly(), the resulting shape is not colored correctly.
This is what happens when I try to draw a filled polygon with four points:
I would not expect the area below and to the left of 0-1 and 1-2 to be filled.It appears that as long as the polygon is convex, it works as expected, but for concave polygons, the color fill is not drawn correctly.
The program is shared here:
ID: 55C63MND5C -
I really hope this gets fixed, as it is kind of a blocker for my new game.
Until that time, if anyone has any insight on how to draw concave polygons using triangles or similar instead, feel free to share...
-
As you describe, the best approach is likely to divide the concave polygons into convex polygons, such as triangles. I am unaware of how to do that automatically, but I would be optimistic that tesselation or triangular mesh algorithms should be "out there" to at least help.
-
Well that’s a shame. I was planning to use that myself sometime. I dare say it’ll be fixed long before I get around to it though :P
-
Turns out it was pretty easy to switch to using triangles instead!