Original Post
Hullo! I've been working on an algorithm for converting a series of connected lines, or vertices, into a triangular patch. If the connected lines define a convex region this is relatively simple to do but it's quite complex when it comes to non-convex thingies. I've managed to create something that works quite well, but it's kind of slow... it involves starting with two vertices and testing which third vertex will make a triangle not overlapping any already created triangle that is still inside the original body being converted, this is repeated until a good match is found. I also use some basic culling so that vertices which cannot be part of any new triangle are removed from the list of vertices being concidered. Anyway, I was wondering if there is a well-known algorithm for building a non-overlapping triangular mesh from a set of lines, or if there is perhaps some better approach I can use instead... i.e. rendering polygons with OpenGL. I tried rendering my lines as polygonal patches in OpenGL but it didn't work and I've read that GL_POLYGON only supports convex polygons. Maybe there is a way to easily divide a non-convex polygon into convex sub-polygons?