Cloth Simulator illustration

Cloth Simulator

A curtain of about 1,200 point masses hangs from pins along its top row, joined by distance constraints into a 44×28 grid. Each frame the points move by Verlet integration under gravity and gusting wind, then a few relaxation passes pull every constraint back toward its rest length. Each thread is coloured by stress — blue when slack, white when taut, red near breaking — so load paths light up as you pull. Grab the cloth with the mouse or a finger and swing it around, switch to cut mode to slice threads under the pointer, and tick the tear box to let overstretched threads snap on their own. Sliders set the wind strength and gravity, reset re-hangs a fresh cloth, and the count of intact threads is reported live.

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

Notes

  • Verlet integration stores each point’s current and previous position; velocity is implicit in the difference, which makes constrained systems remarkably stable (Jakobsen’s "Advanced Character Physics", 2001, built the Hitman ragdolls this way).
  • Constraint relaxation is Gauss–Seidel iteration: each pass moves both endpoints half the length error, and just three passes per frame approximate an inextensible fabric.
  • Threads here fail when stretched past about 2.4× rest length; real fabric fails the same way, with stress concentrating at the edge of an existing hole — which is why a small cut rips onward so easily.
  • Runs 100% in your browser — simulations are computed locally on your device.