Rendering
three.js draws every object with instanced meshes, so hundreds of bodies cost about as much as one draw call per shape type. Soft shadows and a studio environment map do the rest.
static site · real physics
Drag to grab and throw. Click the floor to drop things. Everything here is simulated live in your browser.
three.js draws every object with instanced meshes, so hundreds of bodies cost about as much as one draw call per shape type. Soft shadows and a studio environment map do the rest.
Rapier, a Rust physics engine compiled to WebAssembly, steps the world at a fixed 60 Hz. The headline letters start asleep and wake up as their neighbours get knocked loose.
It's all static files: HTML, CSS, JS and some WASM. Cloudflare Pages serves them from its edge network on the free plan. No build step, no backend.
npx wrangler pages deploy physics-site --project-name my-playground
Or connect the repo in the Cloudflare dashboard and set the build output directory to physics-site.