Creates an instance of ngx array camera.
An array of cameras.
Together these define the camera's viewing frustum.
Camera frustum vertical field of view.
Camera frustum aspect ratio.
Camera frustum near plane.
Camera frustum far plane.
Creates a new Camera. Note that this class is not intended to be called directly; you probably want a PerspectiveCamera or OrthographicCamera instead.
The constructor takes no arguments.
Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.
The default setting for .matrixAutoUpdate for newly created Object3Ds.
The default .up direction for objects, also used as the default position for DirectionalLight, HemisphereLight and Spotlight (which creates lights shining from the top down). Set to ( 0, 1, 0 ) by default.
Array with object's animation clips.
Camera frustum aspect ratio, usually the canvas width / canvas height. Default is 1 (square canvas).
An array of cameras.
Whether the object gets rendered into shadow map. Default is false.
Array with object's children. See Group for info on manually grouping objects.
Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes. When shadow-casting with a DirectionalLight or SpotLight, if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
Same as .customDepthMaterial, but used with PointLight. Default is undefined.
Camera frustum far plane. Default is 2000. Must be greater than the current value of .near plane.
Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.
Horizontal off-center offset in the same unit as .filmGauge. Default is 0.
Object distance used for stereoscopy and depth-of-field effects. This parameter does not influence the projection matrix unless a StereoCamera is being used.
Camera frustum vertical field of view, from bottom to top of view, in degrees. Default is 50.
When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to false
the object gets rendered every frame even if it is not in the frustum of the camera. Default is true
.
The BufferGeometry
Unique number for this object instance.
Used to check whether this or derived classes are Object3Ds. Default is true. You should not change this, as it is used internally for optimisation.
The Material
The local transform matrix.
When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is Object3D.DefaultMatrixAutoUpdate (true).
The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.
When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
This is passed to the shader and used to calculate the position of the object.
Optional name of the object (doesn't need to be unique). Default is an empty string.
Camera frustum near plane. Default is 0.1. The valid range is greater than 0 and less than the current value of the .far plane. Note that, unlike for the OrthographicCamera, 0 is not a valid value for a PerspectiveCamera's near plane.
This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix. The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling). On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
Object's parent in the scene graph. An object can have at most one parent.
A Vector3 representing the object's local position. Default is (0, 0, 0).
This is the matrix which contains the projection.
The inverse of projectionMatrix.
Object's local rotation as a Quaternion.
Whether the material receives shadows. Default is false.
This value allows the default rendering order of scene graph objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of Group, all descendants objects will be sorted and rendered together. Sorting is from lowest to highest renderOrder. Default value is 0.
Object's local rotation (see Euler angles), in radians.
The object's local scale. Default is Vector3( 1, 1, 1 ).
This is used by the .lookAt method, for example, to determine the orientation of the result. Default is Object3D.DefaultUp - that is, ( 0, 1, 0 ).
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.
UUID of this object instance. This gets automatically assigned, so this shouldn't be edited.
Frustum window specification or null. This is set using the .setViewOffset method and cleared using .clearViewOffset.
Object gets rendered if true. Default is true.
Gets or sets the zoom factor of the camera. Default is 1.
The default setting for .matrixAutoUpdate for newly created Object3Ds.
The default .up direction for objects, also used as the default position for DirectionalLight, HemisphereLight and Spotlight (which creates lights shining from the top down). Set to ( 0, 1, 0 ) by default.
Array with object's animation clips.
Camera frustum aspect ratio, usually the canvas width / canvas height. Default is 1 (square canvas).
An array of cameras.
Whether the object gets rendered into shadow map. Default is false.
Array with object's children. See Group for info on manually grouping objects.
Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes. When shadow-casting with a DirectionalLight or SpotLight, if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
Same as .customDepthMaterial, but used with PointLight. Default is undefined.
Camera frustum far plane. Default is 2000. Must be greater than the current value of .near plane.
Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.
Horizontal off-center offset in the same unit as .filmGauge. Default is 0.
Object distance used for stereoscopy and depth-of-field effects. This parameter does not influence the projection matrix unless a StereoCamera is being used.
Camera frustum vertical field of view, from bottom to top of view, in degrees. Default is 50.
When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to false
the object gets rendered every frame even if it is not in the frustum of the camera. Default is true
.
The BufferGeometry
Unique number for this object instance.
Used to check whether this or derived classes are Object3Ds. Default is true. You should not change this, as it is used internally for optimisation.
The Material
The local transform matrix.
When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is Object3D.DefaultMatrixAutoUpdate (true).
The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.
When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
This is passed to the shader and used to calculate the position of the object.
Optional name of the object (doesn't need to be unique). Default is an empty string.
Camera frustum near plane. Default is 0.1. The valid range is greater than 0 and less than the current value of the .far plane. Note that, unlike for the OrthographicCamera, 0 is not a valid value for a PerspectiveCamera's near plane.
This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix. The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling). On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
Object's parent in the scene graph. An object can have at most one parent.
A Vector3 representing the object's local position. Default is (0, 0, 0).
This is the matrix which contains the projection.
The inverse of projectionMatrix.
Object's local rotation as a Quaternion.
Whether the material receives shadows. Default is false.
This value allows the default rendering order of scene graph objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of Group, all descendants objects will be sorted and rendered together. Sorting is from lowest to highest renderOrder. Default value is 0.
Object's local rotation (see Euler angles), in radians.
The object's local scale. Default is Vector3( 1, 1, 1 ).
This is used by the .lookAt method, for example, to determine the orientation of the result. Default is Object3D.DefaultUp - that is, ( 0, 1, 0 ).
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.
UUID of this object instance. This gets automatically assigned, so this shouldn't be edited.
Frustum window specification or null. This is set using the .setViewOffset method and cleared using .clearViewOffset.
Object gets rendered if true. Default is true.
Gets or sets the zoom factor of the camera. Default is 1.
Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent. See Group for info on manually grouping objects.
Adds a listener to an event type.
The type of event to listen to.
The that gets called when the event is fired.
Applies the rotation represented by the quaternion to the object.
Adds object as a child of this, while maintaining the object's world transform. Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
Removes all child objects.
Removes any offset set by the .setViewOffset method.
if true, descendants of the object are also cloned. Default is true.
Returns a clone of this object and optionally all descendants.
Copy the given object into this object. Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
if true, descendants of the object are also copied. Default is true.
Fire an event type.
Returns the current vertical field of view angle in degrees considering .zoom.
Returns the height of the image on the film. If .aspect is less than or equal to one (portrait format), the result equals .filmGauge.
Returns the width of the image on the film. If .aspect is greater than or equal to one (landscape format), the result equals .filmGauge.
Returns the focal length of the current .fov in respect to .filmGauge.
Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
Unique number of the object instance Searches through an object and its children, starting with the object itself, and returns the first with a matching id.
Searches through an object and its children, starting with the object itself, and returns the first with a matching name. Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
String to match to the children's Object3D.name property.
The result will be copied into this Quaternion.
Returns a quaternion representing the rotation of the object in world space.
Checks if listener is added to an event type.
The type of event to listen to.
The that gets called when the event is fired.
Optionally, the .x, .y and .z components of the world space position. Rotates the object to face a point in world space. This method does not support objects having non-uniformly-scaled parent(s).
A vector representing a position in world space.
An optional callback that is executed immediately after a 3D object is rendered. This function is called with the following parameters: renderer, scene, camera, geometry, material, group. Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of Mesh, Line, Points or Sprite. Instances of Object3D, Group or Bone are not renderable and thus this callback is not executed for such objects.
An optional callback that is executed immediately before a 3D object is rendered. This function is called with the following parameters: renderer, scene, camera, geometry, material, group. Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of Mesh, Line, Points or Sprite. Instances of Object3D, Group or Bone are not renderable and thus this callback is not executed for such objects.
Removes object as child of this object. An arbitrary number of objects may be removed.
Removes a listener from an event type.
The type of the listener that gets removed.
The listener that gets removed.
Removes this object from its current parent.
Rotate an object along an axis in object space. The axis is assumed to be normalized.
Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent.
Rotates the object around x axis in local space.
The angle to rotate in radians.
Rotates the object around y axis in local space.
The angle to rotate in radians.
Rotates the object around z axis in local space.
The angle to rotate in radians.
Sets the FOV by focal length in respect to the current .filmGauge. By default, the focal length is specified for a 35mm (full frame) camera.
Calls setFromAxisAngle( axis, angle ) on the .quaternion.
Calls setRotationFromEuler( euler) on the .quaternion.
Calls setFromRotationMatrix( m) on the .quaternion. Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
Copy the given quaternion into .quaternion.
normalized Quaternion
Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups. For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this:
+---+---+---+ | A | B | C | +---+---+---+ | D | E | F | +---+---+---+
then for each monitor you would call it like this:
const w = 1920; const h = 1080; const fullWidth = w * 3; const fullHeight = h * 2;
// A camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ) : this; // B camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ) : this; // C camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ) : this; // D camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ) : this; // E camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ) : this; // F camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ) : this; Note there is no reason monitors have to be the same size or in a grid.
full width of multiview setup
full height of multiview setup
horizontal offset of subcamera
vertical offset of subcamera
width of subcamera
height of subcamera
Convert the camera to three.js JSON Object/Scene format.
Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
Translates object along x axis in object space by distance units.
Distance.
Translates object along y axis in object space by distance units.
Distance.
Translates object along z axis in object space by distance units.
Distance.
Like traverse, but the callback will only be executed for visible objects. Descendants of invisible objects are not traversed. Note: Modifying the scene graph inside the callback is discouraged.
A function with as first argument an object3D object.
Updates the local transform.
Updates the global transform of the object and its descendants.
Updates the camera projection matrix. Must be called after any change of parameters.
Updates the global transform of the object.
recursively updates global transform of ancestors.
recursively updates global transform of descendants.
Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent. See Group for info on manually grouping objects.
Adds a listener to an event type.
The type of event to listen to.
The that gets called when the event is fired.
Applies the rotation represented by the quaternion to the object.
Adds object as a child of this, while maintaining the object's world transform. Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
Removes all child objects.
Removes any offset set by the .setViewOffset method.
if true, descendants of the object are also cloned. Default is true.
Returns a clone of this object and optionally all descendants.
Copy the given object into this object. Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
if true, descendants of the object are also copied. Default is true.
Fire an event type.
Returns the current vertical field of view angle in degrees considering .zoom.
Returns the height of the image on the film. If .aspect is less than or equal to one (portrait format), the result equals .filmGauge.
Returns the width of the image on the film. If .aspect is greater than or equal to one (landscape format), the result equals .filmGauge.
Returns the focal length of the current .fov in respect to .filmGauge.
Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
Unique number of the object instance Searches through an object and its children, starting with the object itself, and returns the first with a matching id.
Searches through an object and its children, starting with the object itself, and returns the first with a matching name. Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
String to match to the children's Object3D.name property.
The result will be copied into this Quaternion.
Returns a quaternion representing the rotation of the object in world space.
Checks if listener is added to an event type.
The type of event to listen to.
The that gets called when the event is fired.
Optionally, the .x, .y and .z components of the world space position. Rotates the object to face a point in world space. This method does not support objects having non-uniformly-scaled parent(s).
A vector representing a position in world space.
An optional callback that is executed immediately after a 3D object is rendered. This function is called with the following parameters: renderer, scene, camera, geometry, material, group. Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of Mesh, Line, Points or Sprite. Instances of Object3D, Group or Bone are not renderable and thus this callback is not executed for such objects.
An optional callback that is executed immediately before a 3D object is rendered. This function is called with the following parameters: renderer, scene, camera, geometry, material, group. Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of Mesh, Line, Points or Sprite. Instances of Object3D, Group or Bone are not renderable and thus this callback is not executed for such objects.
Removes object as child of this object. An arbitrary number of objects may be removed.
Removes a listener from an event type.
The type of the listener that gets removed.
The listener that gets removed.
Removes this object from its current parent.
Rotate an object along an axis in object space. The axis is assumed to be normalized.
Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent.
Rotates the object around x axis in local space.
The angle to rotate in radians.
Rotates the object around y axis in local space.
The angle to rotate in radians.
Rotates the object around z axis in local space.
The angle to rotate in radians.
Sets the FOV by focal length in respect to the current .filmGauge. By default, the focal length is specified for a 35mm (full frame) camera.
Calls setFromAxisAngle( axis, angle ) on the .quaternion.
Calls setRotationFromEuler( euler) on the .quaternion.
Calls setFromRotationMatrix( m) on the .quaternion. Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
Copy the given quaternion into .quaternion.
normalized Quaternion
Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups. For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this:
+---+---+---+ | A | B | C | +---+---+---+ | D | E | F | +---+---+---+
then for each monitor you would call it like this:
const w = 1920; const h = 1080; const fullWidth = w * 3; const fullHeight = h * 2;
// A camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ) : this; // B camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ) : this; // C camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ) : this; // D camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ) : this; // E camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ) : this; // F camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ) : this; Note there is no reason monitors have to be the same size or in a grid.
full width of multiview setup
full height of multiview setup
horizontal offset of subcamera
vertical offset of subcamera
width of subcamera
height of subcamera
Convert the camera to three.js JSON Object/Scene format.
Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
Translates object along x axis in object space by distance units.
Distance.
Translates object along y axis in object space by distance units.
Distance.
Translates object along z axis in object space by distance units.
Distance.
Like traverse, but the callback will only be executed for visible objects. Descendants of invisible objects are not traversed. Note: Modifying the scene graph inside the callback is discouraged.
A function with as first argument an object3D object.
Updates the local transform.
Updates the global transform of the object and its descendants.
Updates the camera projection matrix. Must be called after any change of parameters.
Updates the global transform of the object.
recursively updates global transform of ancestors.
recursively updates global transform of descendants.
Generated using TypeDoc
Array camera
See the ngx3js docs page for details. See the ngx camera page for a live demo.