Skip to content

Camera position and target

The camera configuration stores both the perspective camera position and the OrbitControls target. Reproducing only the position is insufficient because two cameras at the same position can look in different directions.

Configuration

tsx
<ModelLabViewer
  src="/models/product.glb"
  config={{
    camera: {
      position: [4, 2.5, 7],
      target: [0, 0.4, 0],
      fov: 38,
      near: 0.01,
      far: 2000,
      damping: true,
    },
  }}
/>

FOV animation

A rapid increase in FOV combined with forward camera movement creates a speed-warp effect. Avoid using only FOV: camera translation, exposure, lighting, model scale, and easing make the motion feel intentional.

ts
const warp = createFovWarpSequence(config)

Camera controls

  • autoRotate and autoRotateSpeed control idle orbiting.
  • minDistance and maxDistance constrain zoom.
  • damping smooths interaction.
  • controlsWhilePlaying={false} prevents the user from fighting an authored sequence.

Fitting

fitCamera() recalculates framing from model bounds. Changing FOV does not automatically refit, so authored lens effects remain visible.

Released under the MIT License.