Metaballs illustration

Metaballs

Metaballs are blobs defined not by an edge but by a field: each ball adds a bump of “influence” that falls off with distance, the bumps add up across the whole plane, and the surface is drawn wherever the total crosses a threshold. Because the fields blend smoothly, two balls that drift close merge into one gooey shape and pull apart with a stretchy neck, the lava-lamp look. This tool bounces a handful of metaballs around the canvas and renders the blended surface live, with a marching-squares outline and colourful interior shading. Drag the ball count, their size and the threshold, and nudge them with the pointer.

Runs 100% in your browser — simulations are computed locally on your device.

Notes

  • Each ball contributes a value that falls off with distance (like r² over distance squared); summing these fields and drawing one contour line gives the smooth merging surface.
  • The threshold you pick is an isovalue: raising it shrinks the blobs and makes them merge only when very close, lowering it swells them so they fuse from farther apart.
  • Marching squares turns the field into an outline by checking, cell by cell, where the contour crosses each grid edge — the 2D cousin of the marching cubes used for 3D surfaces.
  • Runs 100% in your browser — simulations are computed locally on your device.