Atlaslog
Atlaslog / three.js / API reference / PerspectiveCamera
three.js · API reference

PerspectiveCamera

Quick answer

PerspectiveCamera mimics human and lens perspective, making near objects appear larger than distant ones. Set fov, aspect, near, and far, keep aspect matched to the canvas, and call updateProjectionMatrix() after every projection change. Use setViewOffset() to render tiled, high-resolution images across several frames.

Last verified 2026-11-03 · three.js 0.160.0 · Cite this page
new THREE.PerspectiveCamera ( fov , aspect , near , far ) → PerspectiveCamera
Key points
Example
const camera = new THREE.PerspectiveCamera(
  45,
  stage.clientWidth / stage.clientHeight,
  0.5,
  3000
);

camera.position.set(120, 80, 160);
camera.lookAt(0, 0, 0);
function onResize() {
  const w = stage.clientWidth;
  const h = stage.clientHeight;
  camera.aspect = w / h;
  camera.updateProjectionMatrix();
  renderer.setSize(w, h);
}
camera.setViewOffset(fullWidth, fullHeight, 0, 0, fullWidth / 2, fullHeight);
camera.updateProjectionMatrix();
renderer.setViewport(0, 0, halfWidth, height);
renderer.render(scene, camera);
camera.setViewOffset(fullWidth, fullHeight, fullWidth / 2, 0, fullWidth / 2, fullHeight);
camera.updateProjectionMatrix();
renderer.setViewport(halfWidth, 0, halfWidth, height);
renderer.render(scene, camera);
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). PerspectiveCamera. https://www.jingweizhi.com/en/three/api/perspective-camera.html (accessed 2026-11-03).