Plane.Transform Method |
Language: |
Transforms a plane by a matrix.
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;
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.
Microsoft.DirectX.Plane
A Plane structure that represents the transformed plane.
The input matrix is the inverse transpose of the actual transformation.
This C# code example transforms a plane by applying a non-uniform scale.[C#]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.
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);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.
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center