OrthographicProjection

Orthographic projection camera class. Generates an orthographic projection matrix based on left, right, top, bottom, near, and far planes.

Constructor

new OrthographicProjection(leftopt, rightopt, topopt, bottomopt, nearopt, faropt)

Creates an OrthographicProjection instance.

Parameters:
NameTypeAttributesDefaultDescription
leftnumber<optional>
-1

Left plane of the orthographic box.

rightnumber<optional>
1

Right plane of the orthographic box.

topnumber<optional>
1

Top plane of the orthographic box.

bottomnumber<optional>
-1

Bottom plane of the orthographic box.

nearnumber<optional>
0.1

Near clipping plane.

farnumber<optional>
2000

Far clipping plane.

Members

bottom :number

The bottom plane of the orthographic box.

Type:
  • number
Default Value
  • -1

far :number

The far clipping plane.

Type:
  • number
Default Value
  • 2000

left :number

The left plane of the orthographic box.

Type:
  • number
Default Value
  • -1

near :number

The near clipping plane.

Type:
  • number
Default Value
  • 0.1

The right plane of the orthographic box.

Type:
  • number
Default Value
  • 1

top :number

The top plane of the orthographic box.

Type:
  • number
Default Value
  • 1

Methods

(protected) _updateMatrix()

Updates the orthographic projection matrix.

copy(source) → {OrthographicProjection}

Copies the parameters from another OrthographicProjection.

Parameters:
NameTypeDescription
sourceOrthographicProjection
Returns:

this

Type: 
OrthographicProjection

set(left, right, top, bottom, near, far) → {OrthographicProjection}

Sets all orthographic parameters at once.

Parameters:
NameTypeDescription
leftnumber

The left plane of the orthographic box.

rightnumber

The right plane of the orthographic box.

topnumber

The top plane of the orthographic box.

bottomnumber

The bottom plane of the orthographic box.

nearnumber

The near clipping plane.

farnumber

The far clipping plane.

Returns:

this

Type: 
OrthographicProjection

setSize(width, height) → {OrthographicProjection}

Sets the orthographic box size by width and height, centered at (0, 0).

Parameters:
NameTypeDescription
widthnumber

The width of the orthographic box.

heightnumber

The height of the orthographic box.

Returns:

this

Type: 
OrthographicProjection