OrthographicCamera Class

Module: Cameras

Orthographic Camera is used for 2D like image projection.

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

Constructor

OrthographicCamera

(
  • size
  • aspect
  • mode
  • near
  • far
)

Parameters:

  • size Number

    Camera size relative to resize mode

  • aspect Number

    Aspect ratio X/Y

  • mode Number

    Camera resize mode (RESIZE_HORIZONTAL or RESIZE_VERTICAL)

  • near Number

    Near projection plane

  • far Number

    Far projection plane

Methods

destroy

()

Destroy camera object and remove it from the scene.

render

(
  • renderer
  • scene
)

Render a scene using this camera and the internal EffectComposer.

Parameters:

  • renderer WebGLRenderer

    WebGL renderer to use.

  • scene Scene

    Scene to be rendered.

resize

(
  • x
  • y
)

Resize this camera, should be called every time after resizing the screen.

Parameters:

  • x Number

    Width.

  • y Number

    Height.

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

Aspect ratio X/Y.

Default: 1.0

clearColor

Boolean

Clear screen color flag.

Default: false

clearDepth

Boolean

Clear depth flag.

Default: false

mode

Number

Camera resize mode.

Default: RESIZE_HORIZONTAL

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

size

Number

Camera size relative to resize mode.

Default: 10.0

viewport

Vector2

Camera viewport size.

Values range from 0.0 to 1.0 in screen space.

Attributes

RESIZE_HORIZONTAL

Number

Used to set camera to resize horizontally

RESIZE_VERTICAL

Number

Used to set camera to resize vertically.