Plane
Quick answer
Plane is an infinite plane defined by a unit normal and a signed constant distance from the origin. Use it for clipping, cross-section analysis, and side-of-plane tests with distanceToPoint(), intersectLine(), and applyMatrix4(). setFromCoplanarPoints(a, b, c) derives a plane from three non-collinear points.
new THREE.Plane ( normal , constant )
Key points
- distanceToPoint() returns a signed value: positive on the normal side, zero on the plane.
- setFromNormalAndCoplanarPoint() defines the plane from a normal and one point.
- normalize() rescales the normal and adjusts constant to keep the same plane.
Example
const plane = new THREE.Plane(new THREE.Vector3(0, 1, 0), -120);
const d = plane.distanceToPoint(new THREE.Vector3(0, 150, 0));
console.log(d > 0 ? '在上方' : '在下方');
const ray = new THREE.Ray(
new THREE.Vector3(0, 300, 0),
new THREE.Vector3(0, -1, 0)
);
const hit = plane.intersectLine(ray);
console.log(hit);
Notes
- A non-unit normal makes distanceToPoint() return scaled, meaningless distances.
- intersectLine() returns undefined for parallel lines; check before reading the target.
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Atlaslog (2026). Plane. https://www.jingweizhi.com/en/three/api/plane.html (accessed 2026-11-03).