am working on an algorithm for procedural generation of 3D meshes for caves in a side-scroller game.
The algorithm nicely computes contours and also points inside the caves that are supposed to be anchor points for the mesh. A sample for this can be seen in the following image:
The idea is that each of those anchor points has a distance to the view-pane depending on their distance to the contour. This way the caves have a roughly spherical shape in 3D.
This is also the reason I added those anchor points because having triangles from wall-to-wall would not enable me to have actual 3D caves.
However, the problem now is how to make the triangles. I found a nice implementation of the Delaunay triangulation algorithm. However that yields me the following mesh:
Obviously this algorithm is not aware of what's inside my cave and what is not and thus forms triangles completely outside of the caves. Pruning those outliers does not yield good results because then the contours of the caves are interrupted.
I have heard of "ear cut" algorithms that can work with concave shapes like my outlines. However those are not compatible with the anchor points I require.
What I'd need is a triangulation algorithm that allows me either to add anchor points inside the figure, or that allows me to limit the maximal length of vertices thus computing anchor points on its own.
Is such an algorithm known?
Huge thanks!