Relative Content

Tag Archive for c#algorithmunity-game-enginemesh

Marching square algorithm and concave lines

I’m making an algorithm that makes an ocean mesh by looking at what points in the grid are under or at the ocean level and creating the contour based on the marching squares algorithm. The problem is that there are holes on concave curves (on convex curves the ocean mesh just goes inside the land mesh, which is fine). This is the code for getting the position of purple vertices from the image: