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

Box3

Quick answer

Box3 is an axis-aligned bounding box defined by min and max corner vectors in world space. Build it with setFromObject(), then use intersectsBox(), containsPoint(), union(), or getBoundingSphere() for culling, framing cameras, and range queries. Call applyMatrix4() to transform it, or expandByPoint() to grow it incrementally as points arrive.

Last verified 2026-11-03 · three.js 0.160.0 · Cite this page
new THREE.Box3 ( min , max )
Key points
Example
const box = new THREE.Box3();
box.setFromObject(scene);

const size = box.getSize(new THREE.Vector3());
const center = box.getCenter(new THREE.Vector3());
console.log('范围', size, '中心', center);
const sphere = box.getBoundingSphere(new THREE.Sphere());
const distance = sphere.radius / Math.tan(Math.PI * camera.fov / 360);
camera.position.copy(sphere.center).add(new THREE.Vector3(0, distance * 0.6, distance));
camera.lookAt(sphere.center);
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). Box3. https://www.jingweizhi.com/en/three/api/box3.html (accessed 2026-11-03).