2D, 2.5D and 3D graphics, animation, motion and physics over one shared
scene graph. Not yet published to npm.
Demos
Interactive example sites, built with
--base=/four.js/examples/<name>/ because Pages hosts
this repository under a subpath. Each URL is a real Vite bundle.
one-scene-everything-moves— the §118 flagship: 2D art, lit 3D meshes, bodies,
joints, particles, world text and a screen-space UI panel in one
scene, with pause / slow motion / single-step.
motor-digital-twin— the §119 flagship: an electric-motor digital twin
— a motorised, bearing-constrained rotor on a sprung mount, a PID
speed loop, fault injection, engineering-unit readouts, waveform
charts, and record / seek / replay with save and reload.
first-2d-scene— shapes, input, picking, dragging, tweens and a timeline.