Atlaslog
Atlaslog / three.js / API reference / Object3D
three.js · API reference

Object3D

Quick answer

Object3D is the scene-graph node base class, supplying position, rotation, quaternion, scale, parent, children, and world matrix transforms. Nearly everything added to a scene inherits from it, so understanding add(), traverse(), getWorldPosition(), and matrix updates is essential. Set name for lookup, and layers for selective camera rendering.

Last verified 2026-11-03 · three.js 0.160.0 · Cite this page
new THREE.Object3D ()
Key points
Example
const building = new THREE.Group();
building.position.set(120, 0, -40);

const floor = new THREE.Mesh(floorGeometry, floorMaterial);
floor.position.y = 3;
building.add(floor);

const roof = new THREE.Mesh(roofGeometry, roofMaterial);
roof.position.y = 9;
floor.add(roof);          // 挂在地板下,跟随地板的变换

scene.add(building);
const worldPos = roof.getWorldPosition(new THREE.Vector3());
console.log(worldPos);
building.traverse(function (obj) {
  if (obj.isMesh) {
    obj.castShadow = true;
  }
});
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). Object3D. https://www.jingweizhi.com/en/three/api/object3d.html (accessed 2026-11-03).