- I got a
Plane
(Normal, d) and aVector3
point (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.