Project Type:
Development Engine:
Programming Language:
Team Size:
Role:
Duration:
Implemented:
Procedural Programming
Unity
C#
1
Programmer
2 weeks
Marching Squares
I created an implementation of the Marching Squares algorithm in Unity. This technique involved storing 'saddle points' which depending on how the 4 points of a square were activated, would result in 1 of 16 variations. By activating points in a dense 2D grid of marching squares, a carving effect is made. Since this code actively monitors and stores all points, it creates the Mesh itself with the exposed points of the marching squares array. As well, I powered an EdgeCollider using the same points which enabled interactions with Unitys physics system. Finally, I extended the marching squares algorithm by using interpolation of middlepoints. All of the 16 variations of marching squares are different cutups of squares, but all contour lines are always cut from one midpoint to another. So, by allowing midpoints to interpolate from top-to-bottom/left-to-right based on 0 to 1 allowed for the marching squares to behave even more dynamically.