Skip to content

Latest commit

 

History

History
139 lines (87 loc) · 3.51 KB

d3dxplanetransform.md

File metadata and controls

139 lines (87 loc) · 3.51 KB
description ms.assetid title ms.topic ms.date topic_type api_name api_type api_location
D3DXPlaneTransform function (D3dx9math.h) - Transforms a plane by a matrix. The input matrix is the inverse transpose of the actual transformation.
3581b397-cbd8-4aed-80dd-1841f331a367
D3DXPlaneTransform function (D3dx9math.h)
reference
05/31/2018
APIRef
kbSyntax
D3DXPlaneTransform
LibDef
d3dx9.lib
d3dx9.dll

D3DXPlaneTransform function (D3dx9math.h)

Note

The D3DX utility library is deprecated. We recommend that you use DirectXMath instead.

Transforms a plane by a matrix. The input matrix is the inverse transpose of the actual transformation.

Syntax

D3DXPLANE* D3DXPlaneTransform(
  _Inout_       D3DXPLANE  *pOut,
  _In_    const D3DXPLANE  *pP,
  _In_    const D3DXMATRIX *pM
);

Parameters

pOut [in, out]

Type: D3DXPLANE*

Pointer to the D3DXPLANE structure that contains the resulting transformed plane. See example.

pP [in]

Type: const D3DXPLANE*

Pointer to the input D3DXPLANE structure, which contains the plane that will be transformed. The vector (a,b,c) that describes the plane must be normalized before this function is called. See example.

pM [in]

Type: const D3DXMATRIX*

Pointer to the source D3DXMATRIX structure, which contains the transformation values. This matrix must contain the inverse transpose of the transformation values.

Return value

Type: D3DXPLANE*

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.

Remarks

Examples

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.

Requirements

Requirement Value
Header
D3dx9math.h
Library
D3dx9.lib

See also

Math Functions

D3DXPlaneNormalize

D3DXMatrixRotationX

D3DXMatrixRotationY

D3DXMatrixRotationZ

D3DXMatrixInverse

D3DXMatrixTranspose