PerspectiveProjection

Perspective projection camera class. Generates a perspective projection matrix based on field of view, aspect ratio, near and far planes. Field of view is specified in degrees.

Constructor

new PerspectiveProjection(fovopt, aspectopt, nearopt, faropt)

Creates a PerspectiveProjection instance.

Parameters:
NameTypeAttributesDefaultDescription
fovnumber<optional>
50

Vertical field of view in degrees.

aspectnumber<optional>
1

Aspect ratio (width / height).

nearnumber<optional>
0.1

Near clipping plane.

farnumber<optional>
2000

Far clipping plane.

Members

aspect :number

The aspect ratio (width / height).

Type:
  • number
Default Value
  • 1

far :number

The far clipping plane.

Type:
  • number
Default Value
  • 2000

fov :number

The vertical field of view in degrees.

Type:
  • number
Default Value
  • 50

near :number

The near clipping plane.

Type:
  • number
Default Value
  • 0.1

Methods

(protected) _updateMatrix()

Updates the perspective projection matrix.

copy(source) → {PerspectiveProjection}

Copies the parameters from another PerspectiveProjection.

Parameters:
NameTypeDescription
sourcePerspectiveProjection
Returns:

this

Type: 
PerspectiveProjection

set(fov, aspect, near, far) → {PerspectiveProjection}

Sets all perspective parameters at once.

Parameters:
NameTypeDescription
fovnumber

Vertical field of view in degrees.

aspectnumber

Aspect ratio (width / height).

nearnumber

Near clipping plane.

farnumber

Far clipping plane.

Returns:

this

Type: 
PerspectiveProjection