Object3D - Base class for scene graph objects

Constructor

class Object3D()

Base class for scene graph objects

Attributes

Object3D.id

Unique number of this object instance

Object3D.name

Optional name of the object (doesn’t have to be unique)

Scene graph attributes

Object3D.parent

Object’s parent in scene graph

Object3D.children

Array with object’s children

Transform attributes

Object3D.position

Object’s local position

Vector3() - default ( 0, 0, 0 )

Object3D.rotation

Object’s local rotation (Euler angles)

Vector3() - default ( 0, 0, 0 )

Object3D.eulerOrder

Order of axis for Euler angles

string - default XYZ

Object3D.scale

Object’s local scale

Vector3() - default ( 1, 1, 1 )

Object3D.up

Up direction

Vector3() - default ( 0, 1, 0 )

Object3D.matrix

Local transform

Matrix4()

Object3D.matrixWorld

Global transform

Matrix4()

Object3D.matrixRotationWorld

Global rotation

Matrix4()

Object3D.quaternion

Rotation quaternion

Quaternion()

Object3D.useQuaternion

Use quaternion instead of Euler angles for specifying local rotation

boolean - default false

Object3D.boundRadius

float - default 0.0

Object3D.boundRadiusScale

Maximum scale from X, Y, Z scale components

float - default 1.0

Object3D.renderDepth

Override depth-sorting order if non null

float - default null

Appearance flags

Object3D.visible

Object gets rendered if true

boolean - default true

Object3D.doubleSided

Both sides of faces visible if true

default false

Object3D.flipSided

Backside of face visible

default false

Object3D.castShadow

Gets rendered into shadow map

boolean - default false

Object3D.receiveShadow

Material gets baked in shadow receiving

boolean - default false

Scene graph flags

Object3D.frustumCulled

boolean - default true

Object3D.matrixAutoUpdate

boolean - default true

Object3D.matrixWorldNeedsUpdate

boolean - default true

Object3D.rotationAutoUpdate

boolean - default true

Methods

Object3D.translate (distance, axis)

Translates object along arbitrary axis by distance

Arguments:
  • distance (float) – distance
  • axis (Vector3) – translation direction
Object3D.translateX (distance)

Translates object along X-axis by distance

Arguments:
  • distance (float) – distance
Object3D.translateY (distance)

Translates object along Y-axis by distance

Arguments:
  • distance (float) – distance
Object3D.translateZ (distance)

Translates object along Z-axis by distance

Arguments:
  • distance (float) – distance
Object3D.lookAt (vector)

Rotates object to face point in space

Arguments:
Object3D.add (object)

Adds child object to this object

Arguments:
Object3D.remove (object)

Removes child object from this object

Arguments:
Object3D.getChildByName (name, doRecurse)

Gets first child with name matching the argument (searches whole subgraph recursively if flag is set).

Arguments:
  • name (string) – child name
  • doRecurse (boolean) – recurse flag
Returns:

child with matching name or undefined

Rtype :

Object3D()

Object3D.updateMatrix ()

Updates local transform

Object3D.updateMatrixWorld (force)

Updates global transform of the object and its children

Example

Previous topic

Matrix4 - A 4x4 Matrix

Next topic

Projector - Utilities for projecting primitives between spaces

This Page