Author: Evan Jonson
This is a fluids simulator using Metaballs and Spring Mechanics in WebGL 1.0. It runs in your browser.
Metaballs, also known as blobby objects, are n-dimensional isosurfaces that meld together when in close proximity.
Marching Cubes is the algorithm used here to create the triangle meshes. The algorithm divides the world space into a scalar field. Particle locations are used to update these scalar values to determine where the isosurface is. For more information on how this is applied to metaballs, check out Paul Bourke's "Polygonizing a scalar field".
Spring mechanics (Hooke's Law) are used here to simulate fluids by applying forces to the blobs relative to their proximity. For more information on how this is applied to particles, check out Ahmad Moussa's "Spring Physics, Particles and Meshes".
You can run it right here using Github Pages! Check out my demo!