Hi all, I've spent the last couple days trying to implement a marching square algorithm in Unity2D. The attached photo is my current progress but I now need to start working on generating all the points for a mesh. The problem I'm having is wrapping the contour lines around the edges to close the loops. Anyone have experience with this that could lead my in the right direction?
#Tracing around chunk edge with Marching Squares
1 messages · Page 1 of 1 (latest)
You could grow your grid 1 bigger on all sides and keep them empty, your marching algorithm should then wrap around
nvm, I think I misunderstood the question
Well, actually it still holds that the way the mesh is often generated you don't need the edge loops at all, rather just generate the mesh directly for each cell. The mesh generated by that method would still be quite inefficient and therefore I fully understand if you wanna go for more effectively triangulated one. What Sidia said should work for the edges