PerspectiveCamera Class

Module: Cameras

Perspective camera, used for 3D scenes with objects getting smaller as they get away from the camera.

Based on THREE.PerspectiveCamera, original documentation available at https://threejs.org/docs/index.html#Reference/Cameras/PerspectiveCamera.

Constructor

PerspectiveCamera

(
  • fov
  • aspect
  • near
  • far
)

Parameters:

  • fov Number

    Field of view

  • aspect Number

    Aspect ratio

  • near Number

    Near projection plane (how closer can be objects visible by this camera)

  • far Number

    Far projection plane (how far can be objects visible by this camera)

Methods

destroy

()

Destroy camera object and remove it from the scene.

toJSON

(
  • meta
)
Object

Serialize object to JSON.

Parameters:

  • meta Object

Returns:

Object:

JSON descrition

updateProjectionMatrix

()

Update camera projection matrix.

Should be called after chaging projection parameters.

Properties

aspect

Number

Camera aspect ratio X/Y.

Default: 1.0

clearColor

Boolean

Clear screen color flag.

Default: false

clearDepth

Boolean

Clear depth flag.

Default: false

fov

Number

Camera field of view in degrees.

Default: 50

offset

Vector2

Camera viewport offset.

Values range from 0.0 to 1.0 in screen space.

order

Number

Camera draw order preference.

If more than one camera has the same order value the draw order is undefined for those cameras.

Default: 0

viewport

Vector2

Camera viewport size.

Values range from 0.0 to 1.0 in screen space.

zoom

Number

Camera zoom.

Default: 1.0