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

Sphere

Quick answer

Sphere is a bounding volume defined by a center Vector3 and a radius, used by frustum culling and coarse ray tests. Compute it with setFromPoints(), test overlap via intersectsBox() or intersectsSphere(), and guard against the empty state where radius is negative.

Last verified 2026-11-03 · three.js 0.160.0 · Cite this page
new THREE.Sphere ( center , radius )
Key points
Example
geometry.computeBoundingSphere();
const bound = geometry.boundingSphere.clone().applyMatrix4(mesh.matrixWorld);
const frustum = new THREE.Frustum();
frustum.setFromProjectionMatrix(
  new THREE.Matrix4().multiplyMatrices(
    camera.projectionMatrix,
    camera.matrixWorldInverse
  )
);

console.log('是否可见', frustum.intersectsSphere(bound));
const sphere = new THREE.Sphere();
const hit = raycaster.ray.intersectsSphere(sphere.set(mesh.position, 3.2));
if (hit) {
  raycaster.intersectObject(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). Sphere. https://www.jingweizhi.com/en/three/api/sphere.html (accessed 2026-11-03).