It's actually very refreshing to see that someone else has also attempted this at one point, besides me (I've been writing an engine in OpenGL that builds terrain off of this concept, but also puts it in 3d).
That being said, Spektre is right on the money. I have several rules my engine follows that are similiar to his:
Stick to CW or CCW winding (I am using CW)
It's only triangles that I am splitting into even smaller triangles, so they are all convex -- so there are no concave polygons.
The formula for detecting the number of triangles you'll split into is N - 2
, where N
is the number of points in the cell. Obviously if it's 3
, you have a perfect triangle (such as the blue triangle in the grid cell above)
I will try to upload some pictures for you later. Hopefully you are still working on this or at least made progress!