Skip to main content

frustum

Function frustum 

Source
pub fn frustum(
    left: f32,
    right: f32,
    bottom: f32,
    top: f32,
    near: f32,
    far: f32,
) -> Mat4
Expand description

Creates a perspective projection matrix from a frustum for use with OpenGL.

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

This is the OpenGL glFrustum equivalent. See https://registry.khronos.org/OpenGL-Refpages/gl2.1/xhtml/glFrustum.xml

ยงPanics

Will panic if left is equal to right, if bottom is equal to top, or if near or far are less than or equal to zero, or if near is equal to far, when glam_assert is enabled.