The ProjectOnNormal
method projects the current Vector3
instance onto a specified normal vector. This operation is useful in various geometric calculations, such as determining the component of a vector that lies along a particular direction.
The ProjectOnNormal
method projects the current Vector3
instance onto a specified normal vector. This operation is useful in various geometric calculations, such as determining the component of a vector that lies along a particular direction.
To use the ProjectOnNormal
method, you need to have a Vector3
instance and a normal vector onto which you want to project the instance. The method modifies the normal vector to store the result of the projection.
Vector3 vector = new Vector3(3, 4, 5); Vector3 normal = new Vector3(0, 1, 0); Vector3 projectedVector = vector.ProjectOnNormal(ref normal); // projectedVector now contains the projection of 'vector' onto 'normal'.