MotionLightweight
Rigid body physics
Solid objects that fall, bounce and stack.
Solid objects that fall, bounce, stack and knock each other over. Drop letters onto the floor, pile up boxes, push things with the cursor. Rapier is the modern engine for the web.
- Breaks when
- needs a fixed timestep or it explodesWASM engines add load time
- Also called
- Rapier, cannon-es, Matter.js, physics engine
Prompts
Pile of objects you can push
Three.js + Rapier (@dimforge/rapier3d-compat): 40 rounded boxes and spheres dropped into an invisible box the size of the viewport (walls from the camera frustum at z = 0), restitution 0.2, friction 0.6, fixed timestep 1/60 with an accumulator. The pointer is a kinematic sphere collider that follows the cursor and shoves things. Sleep bodies at rest; wake them on pointer proximity. Show the body count and the physics step time.
Physics-driven typography
The headline’s letters as Rapier cuboid bodies (one per glyph, sized from measureText), initially frozen; on click they drop, collide and settle on the page’s baseline as a floor. Render with HTML spans synced to body positions each frame (translate3d), not canvas. Respect reduced motion by never dropping.
Rope and hinge
A hanging sign in Rapier: a fixed anchor, a chain of 8 capsule bodies joined by spherical joints, and a rigid sign body on a revolute joint at the end. Wind as a sine force. Explain joint limits and why the chain needs more solver iterations than the boxes.
Related
Resources · 5
- Bruno Simon portfolioDrive a car through a baked scene; the reference 3D portfolio.bruno_simonsite · demoAug 15, 2026
- Rapier physics (JS/WASM)Deterministic and fast; @react-three/rapier wraps it.dimforgeGitHub · codeAug 1, 2026
- Matter.jsliabrusite · code · demoApr 8, 2026
- three.js example: Ammo clothmrdoobsite · code · demoApr 5, 2026
- three.js example: WebXR ball shootermrdoobsite · code · demoMar 10, 2026