CameraRig.ts

three.js and WebGL · A camera move · MIT

What it does

A follow camera at a fixed offset that eases toward its target with an exponential lag (1 - exp(-dt / lag)) and looks slightly ahead of it. Frame-rate independent, so it steps cleanly with any delta.

Get it

const rig = new CameraRig(camera); rig.snapTo(target); each frame: rig.update(dt, target, 0.16);

Source on GitHub
Needs (the whole pack)

Nothing to read the skills. To run what they build: Node and npm, Python 3 for the helper scripts, and Chromium through Playwright for the inspector and tests. Optional and paid: Tripo, Gemini and ElevenLabs keys for the three generator skills.

License

MIT

License notes are on the pack's page

From

Three.js Game Skills

Everything from Three.js Game Skills in the gallery

Back to the Asset Library