I'm currently working with three.js plane to calculate the distance from a point to a plane.
After determining the normal of the plane using points a, b, and c as follows:
const v = a.clone().sub(c);
const u = b.clone().sub(c);
const normal = u.cross(v);
I then create the plane like this:
const plane = new THREE.Plane(normal, (?))
What should I provide in the second argument?
According to the documentation:
the negative distance from the origin to the plane along the normal vector. Default is 0.
Can you explain what this means?
If I use the distance of one of the points a, b, or c to (0,0,0) as the second argument, such as
const dist = a.distanceTo(new THREE.Vector3(0,0,0))
, when I try:
plane.distanceToPoint(a);
No matter what value I use for the second argument, including leaving it empty, I receive a large number instead of zero. How can I position the plane correctly so that the distance to points on the plane is actually zero as expected?