Group
Quick answer
Group is a scene-graph container without geometry or material that applies one transform to all its children. Use it to organize layers, carry a local coordinate system, or toggle visibility of a whole set through the visible flag. attach() adds children while preserving their world transform, unlike add().
new THREE.Group () → Group
Key points
- position, rotation, and scale on the group compose with each child's own local transform.
- Setting visible to false skips the entire subtree during rendering.
- Name groups and find them with getObjectByName() when debugging imported hierarchies.
Example
const buildings = new THREE.Group();
buildings.name = 'layer-buildings';
const roads = new THREE.Group();
roads.name = 'layer-roads';
scene.add(buildings, roads);
roads.visible = false;
buildings.position.set(0, 0.2, 0);const site = new THREE.Group();
site.position.set(1240, 0, -860);
const building = new THREE.Mesh(buildingGeometry, buildingMaterial);
building.position.set(0, 12, 0);
site.add(building);
scene.add(site);
const world = new THREE.Vector3();
building.getWorldPosition(world);
Notes
- remove() and clear() detach children without disposing their geometry or materials.
- Nesting deep groups multiplies matrix updates; static groups can disable matrixAutoUpdate.
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Atlaslog (2026). Group. https://www.jingweizhi.com/en/three/api/group.html (accessed 2026-11-03).