Concave polygons
Posted: Thu Oct 29, 2020 8:28 pm
Just found out the hard way that attempting to call rendering.draw_polygon with vertices that aren't a convex hull results in odd and unpredictable results.
My workaround is having to break the shape down into convex parts myself and render them separately, which is not ideal.
Could support for concave polygons be added?
EDIT: Or at least update the API docs to specify that only convex polygons are supported, because I spent way too long "debugging" this!
EDIT2: Turns out that even with concave shapes, an alpha value on the colour doesn't work well as some parts are drawn over multiple times. I finally had to break my shape down all the way to individual triangles to get it working properly.
My workaround is having to break the shape down into convex parts myself and render them separately, which is not ideal.
Could support for concave polygons be added?
EDIT: Or at least update the API docs to specify that only convex polygons are supported, because I spent way too long "debugging" this!
EDIT2: Turns out that even with concave shapes, an alpha value on the colour doesn't work well as some parts are drawn over multiple times. I finally had to break my shape down all the way to individual triangles to get it working properly.