Builds a right-handed perspective projection matrix.
XMMATRIX XMMatrixPerspectiveRH(
float ViewWidth,
float ViewHeight,
float NearZ,
float FarZ
)
ViewWidth
Type: float
Width of the frustum at the near clipping plane.
ViewHeight
Type: float
Height of the frustum at the near clipping plane.
NearZ
Type: float
Distance to the near clipping plane. Must be greater than zero.
FarZ
Type: float
Distance to the far clipping plane. Must be greater than zero.
Type: XMMATRIX
Returns the perspective projection matrix.
For typical usage, NearZ < FarZ. However, if you flip these values so FarZ < NearZ, the result is an inverted z buffer which can provide increased floating-point precision. NearZ and FarZ cannot be the same value.
Header: Declared in directxmath.h.