Funzione D3DXMatrixShadow (D3DX10Math.h)
Nota
La libreria di utilità D3DX10 è deprecata. È consigliabile usare invece DirectXMath .
Compila una matrice che rende flat la geometria in un piano.
Sintassi
D3DXMATRIX* D3DXMatrixShadow(
_Inout_ D3DXMATRIX *pOut,
_In_ const D3DXVECTOR4 *pLight,
_In_ const D3DXPLANE *pPlane
);
Parametri
-
pOut [in, out]
-
Tipo: D3DXMATRIX*
Puntatore alla struttura D3DXMATRIX risultante dall'operazione.
-
pLight [in]
-
Tipo: const D3DXVECTOR4*
Puntatore a D3DXVECTOR4 che descrive la posizione della luce.
-
pPlane [in]
-
Tipo: const D3DXPLANE*
Puntatore all'origine D3DXPLANE.
Valore restituito
Tipo: D3DXMATRIX*
Puntatore a una struttura D3DXMATRIX che rende flat la geometria in un piano.
Commenti
La funzione D3DXMatrixShadow appiattisce la geometria in un piano, come se si gettasse un'ombreggiatura da una luce.
Il valore restituito per questa funzione è lo stesso valore restituito nel parametro pOut. In questo modo, la funzione D3DXMatrixShadow può essere usata come parametro per un'altra funzione.
Questa funzione usa la formula seguente per calcolare la matrice restituita.
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
Se il componente w-della luce è 0, il raggio dall'origine alla luce rappresenta una luce direzionale. Se è 1, la luce è una luce punto.
Requisiti
Requisito | Valore |
---|---|
Intestazione |
|
Libreria |
|
Vedi anche