Matrix.Shadow Method

Language:

Builds a matrix that flattens geometry into a plane.

Definition

Visual Basic Public Sub Shadow( _
    ByVal light As Vector4, _
    ByVal plane As Plane _
)
C# public void Shadow(
    Vector4 light,
    Plane plane
);
C++ public:
void Shadow(
    Vector4 light,
    Plane plane
);
JScript public function Shadow(
    light : Vector4,
    plane : Plane
);

Parameters

light Microsoft.DirectX.Vector4
A Vector4 structure that describes the light's position.
plane Microsoft.DirectX.Plane
Source Plane structure.

Remarks

The Shadow method flattens geometry into a plane, as if it were casting a shadow from a light.

This method 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 light's origin represents a directional light. If the w-component is 1, the light is a point light.


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