This is a conversion of an old-school demo scene effect, often called metaballs, which used to appear in several demos during the Atari/Amiga period in the early nineties.

The physics idea is based on simulated gravity acting on mass distribution. The effect is quite familiar to the old lava lamps, where a slimy material suspended in liquid is shape-shifted by the heat.

I wrote this code in Java during December 2000. Everything is done in real-time so run this applet on a reasonably fast computer. I got approx 50 fps on my Pentium 733 MHz CPU, but it still runs with a decent frame rate on slower CPUs.

Update: Java Applets are no longer supported in web browsers for security reasons, so the demo will be hard to run.