pub fn persp_matrix(width: u32, height: u32, fov_zoom: f32) -> [[f32; 4]; 4] {
    let zfar = 1024.0;
    let znear = 0.1;

    // let (width, height) = target.get_dimensions();
    let aspect_ratio = height as f32 / width as f32;
    let fov: f32 = 3.141592 / fov_zoom;
    let f = 1.0 / (fov / 2.0).tan();

    [
        [f *   aspect_ratio   ,    0.0,              0.0              ,   0.0],
        [         0.0         ,     f ,              0.0              ,   0.0],
        [         0.0         ,    0.0,  (zfar+znear)/(zfar-znear)    ,   1.0],
        [         0.0         ,    0.0, -(2.0*zfar*znear)/(zfar-znear),   0.0],
    ]
}
/// Returns a column-major perspective matrix.
Returns a column-major perspective matrix.
Returns a column - major perspective matrix .
pub fn persp_matrix(width: u32, height: u32, fov_zoom: f32) -> [[f32; 4]; 4] {
    let zfar = 1024.0;
    let znear = 0.1;
    // let (width, height) = target.get_dimensions();
    let aspect_ratio = height as f32 / width as f32;
    let fov: f32 = 3.141592 / fov_zoom;
    let f = 1.0 / (fov / 2.0).tan();
    [
        [f *   aspect_ratio   ,    0.0,              0.0              ,   0.0],
        [         0.0         ,     f ,              0.0              ,   0.0],
        [         0.0         ,    0.0,  (zfar+znear)/(zfar-znear)    ,   1.0],
        [         0.0         ,    0.0, -(2.0*zfar*znear)/(zfar-znear),   0.0],
    ]
}
pub fn persp_matrix ( width : u32 , height : u32 , fov_zoom : f32 ) -> [ [ f32 ; 4 ] ; 4 ] { let zfar = 1024.0 ; let znear = 0.1 ; // let (width, height) = target.get_dimensions(); let aspect_ratio = height as f32 / width as f32 ; let fov : f32 = 3.141592 / fov_zoom ; let f = 1.0 / ( fov / 2.0 ) . tan ( ) ; [ [ f * aspect_ratio , 0.0 , 0.0 , 0.0 ] , [ 0.0 , f , 0.0 , 0.0 ] , [ 0.0 , 0.0 , ( zfar + znear ) / ( zfar - znear ) , 1.0 ] , [ 0.0 , 0.0 , - ( 2.0 * zfar * znear ) / ( zfar - znear ) , 0.0 ] , ] }
Returns a column-major perspective matrix.
Returns a column - major perspective matrix .
width
u32
height
u32
fov_zoom
f32
width
u32
height
u32
fov_zoom
f32