[−][src]Function directx_math::XMMatrixPerspectiveRH
pub fn XMMatrixPerspectiveRH(
ViewWidth: f32,
ViewHeight: f32,
NearZ: f32,
FarZ: f32
) -> XMMATRIX
Builds a right-handed perspective projection matrix.
Parameters
ViewWidth
Width of the frustum at the near clipping plane.
ViewHeight
Height of the frustum at the near clipping plane.
NearZ
Distance to the near clipping plane. Must be greater than zero.
FarZ
Distance to the far clipping plane. Must be greater than zero.
Return value
Returns the perspective projection matrix.
Remarks
For typical usage, NearZ
is less than FarZ
. However, if you flip these values so FarZ
is less than NearZ
,
the result is an inverted z
buffer which can provide increased floating-point precision. NearZ
and FarZ
cannot be the same value.
Reference
https://docs.microsoft.com/en-us/windows/win32/api/directxmath/nf-directxmath-XMMatrixPerspectiveRH