OrthographicCamera Class

Module: Cameras

Orthographic Camera is used for 2D like image projection.

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

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
  • viewport
)

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

Updates the viewport, rendering composer and the camera projection matrix.

Parameters:

  • x Number

    Width of the screen.

  • y Number

    Height of the screen.

  • viewport Viewport

    Viewport that encapsulates the viewport of the camera.

setupRenderer

(
  • renderer
)

Prepare the renderer to render the frame using the camera settings.

Should be called before the render() method to setup clear configuration and viewport.

Parameters:

  • renderer WebGLRenderer

    WebGL renderer to configure.

updateProjectionMatrix

()

Update camera projection matrix.

Also updates left right, top and bottom values from aspect and size.

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

clearDepth

Boolean

Clear stencil buffer flag.

Default: false

composer

EffectComposer

Effect composed of this camera. Is used to render the scene to the screen and apply effects.

It is inialized with a RenderPass attached to it.

mode

Number

Camera resize mode.

Default: RESIZE_HORIZONTAL

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

Viewport

Camera viewport indicates where the image is drawn on the screen.

Attributes

RESIZE_HORIZONTAL

Number

Used to set camera to resize horizontally

RESIZE_VERTICAL

Number

Used to set camera to resize vertically.