Skip to content

Sequence engine

Keyframe interpolation

sampleSequence() sorts keyframes by time, finds the surrounding pair, applies the destination keyframe's easing function, and linearly interpolates every scalar/vector channel.

Rotation currently interpolates Euler degree values component-wise. For large or complex rotations, author intermediate keyframes to control direction and avoid unexpected long paths.

Playback modes

Time-based

useFrame increments time by delta * speed, handles forward/reverse completion, and optionally wraps.

Deterministic progress

progress maps directly to duration * clamp(progress, 0, 1). This is ideal for scroll, scrubbing, and synchronized external timelines.

Application order

Per frame, the player updates:

  1. Perspective camera position and FOV
  2. Controls target or direct lookAt
  3. Pivot-root model transform
  4. Renderer exposure and scene environment intensity
  5. Ambient, key, and fill intensity
  6. Optional callbacks and completion state

Effect synchronization

A mutable progressRef communicates normalized sequence progress to CinematicEffectDriver without forcing React state updates each frame.

Released under the MIT License.