Perspective math

Three.js Camera FOV Calculator

Calculate a PerspectiveCamera field of view that frames an object by height, distance, aspect ratio, and margin.

Copy the camera setup

This snippet keeps the math explicit so you can adapt it to a bounding box from a loaded GLB model.


          

When to use this

Use it when a model needs consistent framing across screen sizes, especially product viewers, configurators, avatars, thumbnails, and landing page hero scenes.

FAQ

PerspectiveCamera.fov is vertical FOV in degrees. Horizontal FOV depends on aspect ratio, so it changes when the viewport changes.