Skip to main content

perspective

Function perspective 

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

Creates a perspective projection matrix for use with Vulkan.

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

ยงPanics

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