D3DXMatrixShadow function (D3dx9math.h)
Note
The D3DX utility library is deprecated. We recommend that you use DirectXMath instead.
Builds a matrix that flattens geometry into a plane.
Syntax
D3DXMATRIX* D3DXMatrixShadow(
_Inout_ D3DXMATRIX *pOut,
_In_ const D3DXVECTOR4 *pLight,
_In_ const D3DXPLANE *pPlane
);
Parameters
-
pOut [in, out]
-
Type: D3DXMATRIX*
Pointer to the D3DXMATRIX structure that is the result of the operation.
-
pLight [in]
-
Type: const D3DXVECTOR4*
Pointer to a D3DXVECTOR4 structure describing the light's position.
-
pPlane [in]
-
Type: const D3DXPLANE*
Pointer to the source D3DXPLANE structure.
Return value
Type: D3DXMATRIX*
Pointer to a D3DXMATRIX structure that flattens geometry into a plane.
Remarks
The D3DXMatrixShadow function flattens geometry into a plane, as if casting a shadow from a light.
The return value for this function is the same value returned in the pOut parameter. In this way, the D3DXMatrixShadow function can be used as a parameter for another function.
This function uses the following formula to compute the returned matrix.
P = normalize(Plane);
L = Light;
d = -dot(P, L)
P.a * L.x + d P.a * L.y P.a * L.z P.a * L.w
P.b * L.x P.b * L.y + d P.b * L.z P.b * L.w
P.c * L.x P.c * L.y P.c * L.z + d P.c * L.w
P.d * L.x P.d * L.y P.d * L.z P.d * L.w + d
If the light's w-component is 0, the ray from the origin to the light represents a directional light. If it is 1, the light is a point light.
Requirements
Requirement | Value |
---|---|
Header |
|
Library |
|
See also