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

BoxGeometry

Quick answer

BoxGeometry generates a rectangular cuboid from width, height, and depth, with position, normal, uv, index, and six material groups. It is the standard choice for building blocks, equipment housings, and placeholder volumes in a scene. Increase segment counts only when you need subdivision for displacement or per-face deformation.

Last verified 2026-11-03 · three.js 0.160.0 · Cite this page
new THREE.BoxGeometry ( width , height , depth , widthSegments , heightSegments , depthSegments )
Key points
Example
const geometry = new THREE.BoxGeometry(16, 36, 12);

const wall = new THREE.MeshStandardMaterial({ color: 0xa8b2bd, roughness: 0.85 });
const roof = new THREE.MeshStandardMaterial({ color: 0x3f4a55, roughness: 0.6 });
const mesh = new THREE.Mesh(geometry, [wall, wall, roof, wall, wall, wall]);
mesh.position.set(80, 18, -20);
mesh.castShadow = true;
mesh.receiveShadow = true;
scene.add(mesh);
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). BoxGeometry. https://www.jingweizhi.com/en/three/api/box-geometry.html (accessed 2026-11-03).