Class OrthographicCamera

Camera with orthographic projection

example

var camera = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, 1, 1000 ); scene.add( camera );

see

src/cameras/OrthographicCamera.js

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(left: number, right: number, top: number, bottom: number, near?: number, far?: number): OrthographicCamera

Parameters

  • left: number

    Camera frustum left plane.

  • right: number

    Camera frustum right plane.

  • top: number

    Camera frustum top plane.

  • bottom: number

    Camera frustum bottom plane.

  • near?: number optional

    Camera frustum near plane.

  • far?: number optional

    Camera frustum far plane.

Returns

OrthographicCamera

Properties

public bottom: number

Camera frustum bottom plane.

public castShadow: boolean

Gets rendered into shadow map.

public children: Object3D[]

Array with object's children.

public eulerOrder: string

Order of axis for Euler angles.

public far: number

Camera frustum far plane.

public frustumCulled: boolean

When this is set, it checks every frame if the object is in the frustum of the camera. Otherwise the object gets drawn every frame even if it isn't visible.

public id: number

Unique number of this object instance.

public left: number

Camera frustum left plane.

public matrix: Matrix4

Local transform.

public matrixAutoUpdate: boolean

When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property.

public matrixWorld: Matrix4

The global transform of the object. If the Object3d has no parent, then it's identical to the local transform.

public matrixWorldInverse: Matrix4

This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.

public matrixWorldNeedsUpdate: boolean

When this is set, it calculates the matrixWorld in that frame and resets this property to false.

public name: string

Optional name of the object (doesn't need to be unique).

public near: number

Camera frustum near plane.

public parent: Object3D

Object's parent in the scene graph.

public position: Vector3

Object's local position.

public projectionMatrix: Matrix4

This is the matrix which contains the projection.

public quaternion: Quaternion

Global rotation.

public receiveShadow: boolean

Material gets baked in shadow receiving.

public renderDepth: number

Override depth-sorting order if non null.

public right: number

Camera frustum right plane.

public rotation: Euler

Object's local rotation (Euler angles), in radians.

public rotationAutoUpdate: boolean

When this is set, then the rotationMatrix gets calculated every frame.

public scale: Vector3

Object's local scale.

public top: number

Camera frustum top plane.

public up: Vector3

Up direction.

public useQuaternion: boolean

Use quaternion instead of Euler angles for specifying local rotation.

public userData: any

An object that can be used to store custom data about the Object3d. It should not hold references to functions as these will not be cloned.

public visible: boolean

Object gets rendered if true.

Methods

public add(object: Object3D)

Adds object as child of this object.

Parameters

public applyMatrix(matrix: Matrix4)

This updates the position, rotation and scale with the matrix.

Parameters

public clone(): OrthographicCamera

Returns

OrthographicCamera

public getDescendants(array?: Object3D[]): Object3D[]

Searches whole subgraph recursively to add all objects in the array.

Parameters

  • array?: Object3D[] optional

    optional argument that returns the the array with descendants.

Returns

Object3D[]

public getObjectById(id: string, recursive: boolean): Object3D

Searches through the object's children and returns the first with a matching id, optionally recursive.

Parameters

  • id: string

    Unique number of the object instance

  • recursive: boolean

    Boolean whether to search through the children's children. Default is false.

Returns

Object3D

public getObjectByName(name: string, recursive: boolean): Object3D

Searches through the object's children and returns the first with a matching name, optionally recursive.

Parameters

  • name: string

    String to match to the children's Object3d.name property.

  • recursive: boolean

    Boolean whether to search through the children's children. Default is false.

Returns

Object3D

public localToWorld(vector: Vector3): Vector3

Updates the vector from local space to world space.

Parameters

Returns

Vector3

public lookAt(vector: Vector3)

This make the camera look at the vector position in local space.

Parameters

public remove(object: Object3D)

Removes object as child of this object.

Parameters

public rotateOnAxis(axis: Vector3, angle: number): Object3D

Rotate an object along an axis in object space. The axis is assumed to be normalized.

Parameters

  • axis: Vector3

    A normalized vector in object space.

  • angle: number

    The angle in radians.

Returns

Object3D

public translateOnAxis(axis: Vector3, distance: number): Object3D

Parameters

  • axis: Vector3

    A normalized vector in object space.

  • distance: number

    The distance to translate.

Returns

Object3D

public translateX(distance: number)

Translates object along x axis by distance.

Parameters

  • distance: number

    Distance.

public translateY(distance: number)

Translates object along y axis by distance.

Parameters

  • distance: number

    Distance.

public translateZ(distance: number)

Translates object along z axis by distance.

Parameters

  • distance: number

    Distance.

public traverse(callback: (object: THREE.Object3D) => any)

Translates object along arbitrary axis by distance.

Parameters

  • callback: (object: THREE.Object3D) => any

public updateMatrix()

Updates local transform.

public updateMatrixWorld(force: boolean)

Updates global transform of the object and its children.

Parameters

  • force: boolean

public updateProjectionMatrix()

Updates the camera projection matrix. Must be called after change of parameters.

public worldToLocal(vector: Vector3): Vector3

Updates the vector from world space to local space.

Parameters

Returns

Vector3