Hello everyone!
I’m attempting to draw either a mesh or a 2D polygon from a set of Vector2 vertices (my game is 2D). The purpose of this is to create a “shadowed” area where the player can’t see. I have all my vertices but it appears I now need a set of “triangle indexes” to feed into my mesh.
So, how does one create such an array? What are those indexes?
I tried using pre-made algorithms such as the triangulator seen here but it doesn’t cover all cases and often my mesh appears clipped or the triangulation is wrong, “skipping” a few vertices. I would like to create my own algorithm for this if needed but I have no idea what the triangle indexes are supposed to be in the first place.
Also, is there another way to achieve the same effect without programatically drawing a mesh?