Partager via


Fonction D3DXMatrixPerspectiveFovLH (D3dx9math.h)

Notes

La bibliothèque d’utilitaireS D3DX est déconseillée. Nous vous recommandons d’utiliser DirectXMath à la place.

Crée une matrice de projection de perspective pour un système gaucher en fonction d’un champ de vue.

Syntaxe

D3DXMATRIX* D3DXMatrixPerspectiveFovLH(
  _Inout_ D3DXMATRIX *pOut,
  _In_    FLOAT      fovy,
  _In_    FLOAT      Aspect,
  _In_    FLOAT      zn,
  _In_    FLOAT      zf
);

Paramètres

pOut [in, out]

Type : D3DXMATRIX*

Pointeur vers la structure D3DXMATRIX qui est le résultat de l’opération.

fovy [in]

Type : FLOAT

Champ de vue dans la direction y, en radians.

Aspect [in]

Type : FLOAT

Proportion, défini comme largeur d’espace d’affichage divisée par hauteur.

zn [in]

Type : FLOAT

Valeur Z du plan de vue proche.

zf [in]

Type : FLOAT

Valeur Z du plan d’affichage lointain.

Valeur retournée

Type : D3DXMATRIX*

Pointeur vers une structure D3DXMATRIX qui est une matrice de projection de perspective gauche.

Notes

La valeur de retour de cette fonction est la même valeur retournée dans le paramètre pOut . De cette façon, la fonction D3DXMatrixPerspectiveFovLH peut être utilisée comme paramètre pour une autre fonction.

Pour modifier l’axe des proportions, utilisez la formule de calcul : fovy = 2 * math.atan(math.tan(fovy * 0,5) / aspect). Vous pouvez également ajouter des variables de rapport d’aspect X et Y dans la structure pour mettre à l’échelle l’espace d’affichage vertical : fovy = 2 * math.atan(math.tan(fovy * 0,5) / aspectY), aspect = aspectX * aspect Y.

Cette fonction calcule la matrice retournée comme indiqué :

xScale     0          0               0
0        yScale       0               0
0          0       zf/(zf-zn)         1
0          0       -zn*zf/(zf-zn)     0
where:
yScale = cot(fovY/2)

xScale = yScale / aspect ratio

Spécifications

Condition requise Valeur
En-tête
D3dx9math.h
Bibliothèque
D3dx9.lib

Voir aussi

Fonctions mathématiques

D3DXMatrixPerspectiveRH

D3DXMatrixPerspectiveLH

D3DXMatrixPerspectiveFovRH

D3DXMatrixPerspectiveOffCenterRH

D3DXMatrixPerspectiveOffCenterLH