When aligning a THREE.Plane
with a planar Mesh
that has a PlaneGeometry
, it's important to consider the mesh's position
and quaternion
(or rotation
). In this case, you want the plane to match the orientation of the mesh.
An efficient way to achieve this is by using the method
plane.setFromNormalAndCoplanarPoint()
.
The normal represents the direction perpendicular to the rotated plane mesh. The coplanar point can be any point within the plane mesh; typically, its position
is used for this purpose.
var plane = new THREE.Plane();
var normal = new THREE.Vector3();
var point = new THREE.Vector3();
normal.set(0, 0, 1).applyQuaternion(planeMesh.quaternion);
point.copy(planeMesh.position);
plane.setFromNormalAndCoplanarPoint(normal, point);
Implemented in three.js r.96