Skip to main content

unproject_screen_to_ray

Function unproject_screen_to_ray 

pub fn unproject_screen_to_ray(
    screen_x: f64,
    screen_y: f64,
    viewport_width: f64,
    viewport_height: f64,
    inv_vp: &[f64; 16],
) -> Option<Ray3D>
Expand description

Unprojects 2D screen coordinates into a 3D world ray using a $4 \times 4$ inverse view-projection matrix.

inv_vp: 16-element column-major matrix $[M_{col, row}]$.