Skip to main content

perspective_infinite

Function perspective_infinite 

Source
pub fn perspective_infinite(
    vertical_fov: f32,
    aspect_ratio: f32,
    near: f32,
) -> Mat4
Expand description

Creates an infinite perspective projection matrix for use with DirectX and WebGPU.

Like perspective, but with an infinite value for far. Points at distance near map to depth 0; as distance approaches infinity, depth approaches 1.

Expects a right-handed Y-up view space input. Outputs NDC with Z in [0, 1] and Y-up.

ยงPanics

Will panic if near is less than or equal to zero when glam_assert is enabled.