Plane.Transform(Plane,Matrix) Method (Microsoft.DirectX)
Transforms a plane by a matrix.
Definition
Visual Basic Public Shared Function Transform( _
ByVal p As Plane, _
ByVal m As Matrix _
) As PlaneC# public static Plane Transform(
Plane p,
Matrix m
);C++ public:
static Plane Transform(
Plane p,
Matrix m
);JScript public static function Transform(
p : Plane,
m : Matrix
) : Plane;
Parameters
p Microsoft.DirectX.Plane
Input Plane structure, which contains the plane to be transformed. The vector (a,b,c) that describes the plane must be normalized before this method is called.m Microsoft.DirectX.Matrix
Source Matrix structure, which contains the transformation values. This matrix must contain the inverse transpose of the transformation values.
Return Value
Microsoft.DirectX.Plane
A Plane structure that represents the transformed plane.
Remarks
The input matrix is the inverse transpose of the actual transformation.
Examples
This C# code example transforms a plane by applying a non-uniform scale.
[C#] Plane planeNew; Plane plane = new Plane(0, 1, 1, 0); plane = Plane.Normalize(plane); Matrix matrix; matrix = Matrix.Scaling(1.0f, 2.0f, 3.0f); matrix = Matrix.Invert(matrix); matrix.Transpose(matrix); planeNew = Plane.Transform(plane, matrix);
A plane is described by ax + by + cz + dw = 0. The first plane is created with (a, b, c, d) = (0, 1, 1, 0), which is a plane described by y + z = 0. After scaling, the new plane contains (a, b, c, d) = (0, 0.353f, 0.235f, 0), which shows the new plane to be described by 0.353y + 0.235z = 0. The parameter m contains the inverse transpose of the transformation matrix. The inverse transpose is required by this method so that the normal vector of the transformed plane can be correctly transformed as well.
See Also