Funzione D3DXMatrixShadow (D3dx9math.h)

Nota

La libreria di utilità D3DX è deprecata. È consigliabile usare invece DirectXMath .

Compila una matrice che appiattisce 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 che è il risultato dell'operazione.

pLight [in]

Tipo: const D3DXVECTOR4*

Puntatore a una struttura D3DXVECTOR4 che descrive la posizione della luce.

pPlane [in]

Tipo: const D3DXPLANE*

Puntatore alla struttura D3DXPLANE di origine.

Valore restituito

Tipo: D3DXMATRIX*

Puntatore a una struttura D3DXMATRIX che si appiattisce la geometria in un piano.

Commenti

La funzione D3DXMatrixShadow appiattisce la geometria in un piano, come se si esegue il cast di un'ombra 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
D3dx9math.h
Libreria
D3dx9.lib

Vedi anche

Funzioni matematiche