I'm doing some mesh generation for a spare time project, and I've come to a point where I really need to be able to triangulate any specified 2D polygon - i.e. split a 2D polygon (convex or not) into triangles so that I can use those to generate a mesh.
I've looked a bit on what's already available on the Net, and I found these two projects written in C#:
However, I've tested both, and they're both buggy, meaning that they produce incorrect results for many polygons, where some triangles are outside the polygon.
There are much more promising projects with source code floating around, but unfortunately not in C#. For example:
If anyone have done polygon triangulation in Unity before (or just in C#) I'd be very interested in the code for that.