Capítulo 19 de 859
Camera that uses perspective projection.
This projection mode is designed to mimic the way the human eye sees. It is the most common projection mode used for rendering a 3D scene.
35 (millimeters). This parameter does not influence the projection matrix unless [Perspect…0 and less than the current value of [PerspectiveCamera#far](PerspectiveCamera.h…const camera = new THREE.PerspectiveCamera( 45, width / height, 1, 1000 );
scene.add( camera );
Constructor
| Signature |
|---|
new PerspectiveCamera( fov : number, aspect : number, near : number, far : number ) |
Properties
| Property | Description |
|---|---|
.aspect : number | The aspect ratio, usually the canvas width / canvas height. |
.far : number | The camera's far plane. Must be greater than the current value of PerspectiveCamera#near. |
.filmGauge : number | Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless PerspectiveCamera#filmOffset is … |
.filmOffset : number | Horizontal off-center offset in the same unit as PerspectiveCamera#filmGauge. |
.focus : number | Object distance used for stereoscopy and depth-of-field effects. This parameter does not influence the projection matrix unless a StereoCamera is being used. |
.fov : number | The vertical field of view, from bottom to top of view, in degrees. |
.isPerspectiveCamera : boolean (readonly) | This flag can be used for type testing. |
.near : number | The camera's near plane. The valid range is greater than 0 and less than the current value of PerspectiveCamera#far. |
.view : Object | Represents the frustum window specification. This property should not be edited directly but via PerspectiveCamera#setViewOffset and [PerspectiveCamera#clearVi… |
.zoom : number | The zoom factor of the camera. |
Methods
| Method | Description |
|---|---|
.clearViewOffset() | Removes the view offset from the projection matrix. |
.getEffectiveFOV() : number | Returns the current vertical field of view angle in degrees considering PerspectiveCamera#zoom. |
.getFilmHeight() : number | Returns the height of the image on the film. If PerspectiveCamera#aspect is greater than or equal to one (landscape format), the result equals [PerspectiveCamera#film… |
.getFilmWidth() : number | Returns the width of the image on the film. If PerspectiveCamera#aspect is greater than or equal to one (landscape format), the result equals [PerspectiveCamera#filmG… |
.getFocalLength() : number | Returns the focal length from the current PerspectiveCamera#fov and PerspectiveCamera#filmGauge. |
.getViewBounds( distance : number, minTarget : Vector2, maxTarget : Vector2 ) | Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction. Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corner… |
.getViewSize( distance : number, target : Vector2 ) : Vector2 | Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction. |
.setFocalLength( focalLength : number ) | Sets the FOV by focal length in respect to the current PerspectiveCamera#filmGauge. |
.setViewOffset( fullWidth : number, fullHeight : number, x : number, y : number, width : number, height : number ) | Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups. |
.updateProjectionMatrix() | Updates the camera's projection matrix. Must be called after any change of camera properties. |