- I got a
Plane(Normal, d) and aVector3point (x, y, z). - I need to translate the plane to that point for X distance. How do I do that?
I’m coming up with this..
plane = Plane.Transform(plane, Matrix.CreateTranslation(
But can’t figure what to place there. It has to be something with dot product, Plane.Normal and my Vector3.
EDIT:
I’m thinking of this.
public static Plane MoveTo(this Plane p, Vector3 point, float distance)
{
Vector3 planeVector = p.Normal * p.D;
Matrix matrix = Matrix.CreateTranslation(Vector3.Normalize(planeVector)) *
distance * Math.Sign(Vector3.Dot(planeVector, point - planeVector))
return Plane.Transform(p, matrix);
}
If someone considers this as wrong or particually wrong, please, note it.
The distance from a point P to the plane Pi is:
You should calc current d(P, pi), substract to that the amount X, and then only have to calculate D to get the new plane.
EDIT:
To know the relation between a point and a plane, you only have to calculate its equation: R = Ax + By + Cz + D where (A,B,C) is the normal and (x,y,z) the point…
if (R == 0) the point is contained in the plane
if (R>0) the point is front // or viceversa
if (R<0) that point is back