Microsoft DirectX 8.1 (C++) |
Transforms a plane by a matrix. The input matrix is the inverse transpose of the actual transformation.
D3DXPLANE* D3DXPlaneTransform( D3DXPLANE* pOut, CONST D3DXPLANE* pP, CONST D3DXMATRIX* pM );
Pointer to a D3DXPLANE structure, representing the transformed plane. This is the same value returned in the pOut parameter so that this function can be used as a parameter for another function.
This example transforms a plane by applying a non-uniform scale.
D3DXPLANE planeNew; D3DXPLANE plane(0,1,1,0); D3DXPlaneNormalize(&plane, &plane); D3DXMATRIX matrix; D3DXMatrixScaling(&matrix, 1.0f,2.0f,3.0f); D3DXMatrixInverse(&matrix, NULL, &matrix); D3DXMatrixTranspose(&matrix, &matrix); D3DXPlaneTransform(&planeNew, &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 pM, 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.
Header: Declared in D3dx8math.h.
Import Library: Use D3dx8.lib.
D3DXPlaneNormalize, D3DXRotationY, D3DXMatrixInverse, D3DXMatrixTranspose