MotionLightweight
Soft body & cloth
Cloth, jelly and rope that bend and jiggle.
Things that bend and jiggle: cloth, jelly, ropes, balloons. Points connected by springs, so the whole thing reacts when one part is pulled. It never fully settles, which is why it looks alive.
- Breaks when
- unstable without substepsself-collision is expensive
- Also called
- cloth sim, verlet, XPBD, jelly
Prompts
Cloth banner on a Three.js plane
A 40×30 PlaneGeometry simulated as verlet cloth on the CPU: structural and shear constraints, 5 iterations per substep, 3 substeps per frame, top row pinned, wind from a 2D noise field, gravity 9.8 scaled to the mesh. Write positions into the geometry each frame and recompute normals. Pointer: a sphere collider at the cursor that the cloth drapes over. Tear a constraint when it stretches past 2.5×.
Jelly button
A 2D soft-body button: a ring of 24 points with edge, spoke and pressure constraints (target area), verlet integrated, drawn with Canvas 2D as a smooth closed curve. Pressing squashes it; releasing overshoots; hovering nudges it. Keep it under 0.3 ms per frame.
XPBD in a compute shader
Cloth on the GPU with WebGPU: positions and previous positions in storage buffers, a compute pass for integration and 4 Jacobi constraint passes per frame using XPBD compliance, then render as a mesh with normals computed in a final pass. 128×128 cloth at 60 fps; state the memory layout.
Related
Resources · 1
- three.js example: Ammo clothmrdoobsite · code · demoApr 5, 2026