Inheritance: EventDispatcher →
This is the base class for most objects in three.js and provides a set of properties and methods for manipulating objects in 3D space.
Constructs a new 3D object.
An array holding the animation clips of the 3D object.
When set to true, the 3D object gets rendered into shadow maps.
Default is false.
An array holding the child 3D objects of this instance.
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 custom depth material for proper shadows.
Only relevant in context of WebGLRenderer.
Default is undefined.
Same as Object3D#customDepthMaterial, but used with PointLight.
Only relevant in context of WebGLRenderer.
Default is undefined.
When set to true, the 3D object is honored by view frustum culling.
Default is true.
The ID of the 3D object.
This flag can be used for type testing.
Default is true.
The layer membership of the 3D object. The 3D object is only visible if it has at least one layer in common with the camera in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using Raycaster.
Represents the object's transformation matrix in local space.
When set to true, the engine automatically computes the local matrix from position, rotation and scale every frame. If set to false, the app is responsible for recomputing the local matrix by calling updateMatrix().
The default values for all 3D objects is defined by Object3D.DEFAULT_MATRIX_AUTO_UPDATE.
Default is true.
Represents the object's transformation matrix in world space. If the 3D object has no parent, then it's identical to the local transformation matrix
When set to true, the engine automatically computes the world matrix from the current local matrix and the object's transformation hierarchy. If set to false, the app is responsible for recomputing the world matrix by directly updating the matrixWorld property.
The default values for all 3D objects is defined by Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE.
Default is true.
When set to true, it calculates the world matrix in that frame and resets this property to false.
Default is false.
Represents the object's model-view matrix.
The name of the 3D object.
Represents the object's normal matrix.
A reference to the parent object.
Default is null.
The pivot point for rotation and scale transformations. When set, rotation and scale are applied around this point instead of the object's origin.
Default is null.
Represents the object's local position.
Default is (0,0,0).
Represents the object's local rotation as Quaternions.
When set to true, the 3D object is affected by shadows in the scene.
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 render order.
Default is 0.
Represents the object's local rotation as Euler angles, in radians.
Default is (0,0,0).
Represents the object's local scale.
Default is (1,1,1).
Whether the 3D object is supposed to be static or not. If set to true, it means the 3D object is not going to be changed after the initial renderer. This includes geometry and material settings. A static 3D object can be processed by the renderer slightly faster since certain state checks can be bypassed.
Only relevant in context of WebGPURenderer.
Default is false.
The type property is used for detecting the object type in context of serialization/deserialization.
Defines the up direction of the 3D object which influences the orientation via methods like Object3D#lookAt.
The default values for all 3D objects is defined by Object3D.DEFAULT_UP.
An object that can be used to store custom data about the 3D object. It should not hold references to functions as these will not be cloned.
The UUID of the 3D object.
When set to true, the 3D object gets rendered.
Default is true.
The default setting for Object3D#matrixAutoUpdate for newly created 3D objects.
Default is true.
The default setting for Object3D#matrixWorldAutoUpdate for newly created 3D objects.
Default is true.
The default up direction for objects, also used as the default position for DirectionalLight and HemisphereLight.
Default is (0,1,0).
Adds the given 3D object as a child to this 3D 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.
object
The 3D object to add.
Returns: A reference to this instance.
Applies the given transformation matrix to the object and updates the object's position, rotation and scale.
matrix
The transformation matrix.
Applies a rotation represented by given the quaternion to the 3D object.
q
The quaternion.
Returns: A reference to this instance.
Adds the given 3D object as a child of this 3D object, while maintaining the object's world transform. This method does not support scene graphs having non-uniformly-scaled nodes(s).
object
The 3D object to attach.
Returns: A reference to this instance.
Removes all child objects.
Returns: A reference to this instance.
Returns a new 3D object with copied values from this instance.
recursive
When set to true, descendants of the 3D object are also cloned.
Default is true.
Returns: A clone of this instance.
Copies the values of the given 3D object to this instance.
source
The 3D object to copy.
recursive
When set to true, descendants of the 3D object are cloned.
Default is true.
Returns: A reference to this instance.
Searches through the 3D object and its children, starting with the 3D object itself, and returns the first with a matching ID.
id
The id.
Returns: The found 3D object. Returns undefined if no 3D object has been found.
Searches through the 3D object and its children, starting with the 3D object itself, and returns the first with a matching name.
name
The name.
Returns: The found 3D object. Returns undefined if no 3D object has been found.
Searches through the 3D object and its children, starting with the 3D object itself, and returns the first with a matching property value.
name
The name of the property.
value
The value.
Returns: The found 3D object. Returns undefined if no 3D object has been found.
Searches through the 3D object and its children, starting with the 3D object itself, and returns all 3D objects with a matching property value.
name
The name of the property.
value
The value.
result
The method stores the result in this array.
Returns: The found 3D objects.
Returns a vector representing the ("look") direction of the 3D object in world space.
target
The target vector the result is stored to.
Returns: The 3D object's direction in world space.
Returns a vector representing the position of the 3D object in world space.
target
The target vector the result is stored to.
Returns: The 3D object's position in world space.
Returns a Quaternion representing the position of the 3D object in world space.
target
The target Quaternion the result is stored to.
Returns: The 3D object's rotation in world space.
Returns a vector representing the scale of the 3D object in world space.
target
The target vector the result is stored to.
Returns: The 3D object's scale in world space.
Converts the given vector from this 3D object's local space to world space.
vector
The vector to convert.
Returns: The converted vector.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
x
The x coordinate in world space. Alternatively, a vector representing a position in world space
y
The y coordinate in world space.
z
The z coordinate in world space.
A callback that is executed immediately after a 3D object is rendered.
renderer
The renderer.
object
The 3D object.
camera
The camera that is used to render the scene.
geometry
The 3D object's geometry.
material
The 3D object's material.
group
The geometry group data.
A callback that is executed immediately after a 3D object is rendered to a shadow map.
renderer
The renderer.
object
The 3D object.
camera
The camera that is used to render the scene.
shadowCamera
The shadow camera.
geometry
The 3D object's geometry.
depthMaterial
The depth material.
group
The geometry group data.
A callback that is executed immediately before a 3D object is rendered.
renderer
The renderer.
object
The 3D object.
camera
The camera that is used to render the scene.
geometry
The 3D object's geometry.
material
The 3D object's material.
group
The geometry group data.
A callback that is executed immediately before a 3D object is rendered to a shadow map.
renderer
The renderer.
object
The 3D object.
camera
The camera that is used to render the scene.
shadowCamera
The shadow camera.
geometry
The 3D object's geometry.
depthMaterial
The depth material.
group
The geometry group data.
Abstract method to get intersections between a casted ray and this 3D object. Renderable 3D objects such as Mesh, Line or Points implement this method in order to use raycasting.
raycaster
The raycaster.
intersects
An array holding the result of the method.
Removes the given 3D object as child from this 3D object. An arbitrary number of objects may be removed.
object
The 3D object to remove.
Returns: A reference to this instance.
Removes this 3D object from its current parent.
Returns: A reference to this instance.
Rotates the 3D object along an axis in local space.
axis
The (normalized) axis vector.
angle
The angle in radians.
Returns: A reference to this instance.
Rotates the 3D object along an axis in world space.
axis
The (normalized) axis vector.
angle
The angle in radians.
Returns: A reference to this instance.
Rotates the 3D object around its X axis in local space.
angle
The angle in radians.
Returns: A reference to this instance.
Rotates the 3D object around its Y axis in local space.
angle
The angle in radians.
Returns: A reference to this instance.
Rotates the 3D object around its Z axis in local space.
angle
The angle in radians.
Returns: A reference to this instance.
Sets the given rotation represented as an axis/angle couple to the 3D object.
axis
The (normalized) axis vector.
angle
The angle in radians.
Sets the given rotation represented as Euler angles to the 3D object.
euler
The Euler angles.
Sets the given rotation represented as rotation matrix to the 3D object.
m
Although a 4x4 matrix is expected, the upper 3x3 portion must be a pure rotation matrix (i.e, unscaled).
Sets the given rotation represented as a Quaternion to the 3D object.
q
The Quaternion
Serializes the 3D object into JSON.
meta
An optional value holding meta information about the serialization.
See:
Returns: A JSON object representing the serialized 3D object.
Translate the 3D object by a distance along the given axis in local space.
axis
The (normalized) axis vector.
distance
The distance in world units.
Returns: A reference to this instance.
Translate the 3D object by a distance along its X-axis in local space.
distance
The distance in world units.
Returns: A reference to this instance.
Translate the 3D object by a distance along its Y-axis in local space.
distance
The distance in world units.
Returns: A reference to this instance.
Translate the 3D object by a distance along its Z-axis in local space.
distance
The distance in world units.
Returns: A reference to this instance.
Executes the callback on this 3D object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
callback
A callback function that allows to process the current 3D object.
Like Object3D#traverse, but the callback will only be executed for all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
callback
A callback function that allows to process the current 3D object.
Like Object3D#traverse, but the callback will only be executed for visible 3D objects. Descendants of invisible 3D objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
callback
A callback function that allows to process the current 3D object.
Updates the transformation matrix in local space by computing it from the current position, rotation and scale values.
Updates the transformation matrix in world space of this 3D objects and its descendants.
To ensure correct results, this method also recomputes the 3D object's transformation matrix in local space. The computation of the local and world matrix can be controlled with the Object3D#matrixAutoUpdate and Object3D#matrixWorldAutoUpdate flags which are both true by default. Set these flags to false if you need more control over the update matrix process.
force
When set to true, a recomputation of world matrices is forced even when Object3D#matrixWorldNeedsUpdate is false.
Default is false.
An alternative version of Object3D#updateMatrixWorld with more control over the update of ancestor and descendant nodes.
updateParents
Whether ancestor nodes should be updated or not.
Default is false.
updateChildren
Whether descendant nodes should be updated or not.
Default is false.
Converts the given vector from this 3D object's world space to local space.
vector
The vector to convert.
Returns: The converted vector.
Fires when the object has been added to its parent object.
Fires when a new child object has been added.
Fires when a child object has been removed.
Fires when the object has been removed from its parent object.