camera-flythrough-pathslisted
Install: claude install-skill RaveenDi/Skilloadout
# Camera Fly-Through Paths
The camera path is the single biggest factor in whether a 3D site feels cinematic or amateur.
This skill gives you a reusable **CameraRail** and the rules for designing paths.
## Core model
A shot = **position curve** + **target curve** + **timing** + **lens**.
```js
import * as THREE from "three";
export class CameraRail {
constructor({ points, targets, tension = 0.5, closed = false }) {
this.pos = new THREE.CatmullRomCurve3(points, closed, "centripetal", tension);
this.look = new THREE.CatmullRomCurve3(targets, closed, "centripetal", tension);
this.pos.arcLengthDivisions = 2000; // smoother getPointAt on long rails
this._p = new THREE.Vector3();
this._t = new THREE.Vector3();
this._ahead = new THREE.Vector3();
}
// u: 0..1 along the rail (arc-length → constant speed)
apply(camera, u, { bank = 0, fovBase = 45, fovKick = 0 } = {}) {
u = THREE.MathUtils.clamp(u, 0, 1);
this.pos.getPointAt(u, this._p);
this.look.getPointAt(u, this._t);
camera.position.copy(this._p);
camera.lookAt(this._t);
if (bank) {
// bank into turns: compare tangent now vs slightly ahead
const t0 = this.pos.getTangentAt(u);
const t1 = this.pos.getTangentAt(Math.min(u + 0.01, 1));
const turn = t0.clone().cross(t1).y; // + left, - right
camera.rotateZ(THREE.MathUtils.clamp(-turn * bank * 40, -0.25, 0.25));
}
if (fovKick) {
const speed = this.pos.getTangentAt(u).length();
ca