In an attempt to get familiar with Flixel 2.5, I decided to create a very basic 2d metaball thing.
Metaballs are the classic blobby/soft object simulation, and were developed in the early 1980’s to model soft blobby objects that merge together smoothly – like snow or water. These types of object interactions are intractably difficult using straight-up polygon modelling.
“Proper” metaballs involve a bunch of particles, associated density functions, and a way of extracting the isosurface, such as marching cubes, marching tetrahedra or raymarching. This micro-demo does none of these things.
Nevertheless it is conceptually the same, in 2D, except using blur operations to emulate the density functions and using alpha-thresholding to emulate extracting an isosurface and re-rendering.
The code is all available on GitHub, at https://github.com/cocoademon/FlixelBlobs