2D Metaballs Demo using Marching Squares
04 April 2022
Metaballs are organic looking blob like balls that merge and split
apart based on their distances from each other. They can be defined as a
single function or a summation of functions across the x and y plane. By
computing the contours, a very cool picture can be produced in real time
as shown below. However, computing the entirety of the function plane to
a high degree of precision is very expensive. To make it less expensive
and produce a good high quality contour marching squares can be
used. It samples 4 points of a function and interpolates where a
threshold value occurs to draw the outline. I was inspired by
Reducible’s video on how computers can draw weird shapes.