pub fn perpective(fov: f32, aspect: f32, near: f32, far: f32) -> Matrix4 {
        let mut m = Matrix4::zero();
        let s = (fov / 2.0 * std::f32::consts::PI / 180.0).tan();

        m[0][0] = 1.0 / (s * aspect);
        m[1][1] = 1.0 / s;
        m[2][2] = -far / (far - near);
        m[2][3] = -far * near / (far - near);
        m[3][2] = -1.0;

        m
    }
/// Returns a perspective matrix for fov degrees and aspect ratio (width / height).
Returns a perspective matrix for fov degrees and aspect ratio (width / height).
Returns a perspective matrix for fov degrees and aspect ratio ( width / height ) .
pub fn perpective(fov: f32, aspect: f32, near: f32, far: f32) -> Matrix4 {
        let mut m = Matrix4::zero();
        let s = (fov / 2.0 * std::f32::consts::PI / 180.0).tan();
        m[0][0] = 1.0 / (s * aspect);
        m[1][1] = 1.0 / s;
        m[2][2] = -far / (far - near);
        m[2][3] = -far * near / (far - near);
        m[3][2] = -1.0;
        m
    }
pub fn perpective ( fov : f32 , aspect : f32 , near : f32 , far : f32 ) -> Matrix4 { let mut m = Matrix4 :: zero ( ) ; let s = ( fov / 2.0 * std :: f32 :: consts :: PI / 180.0 ) . tan ( ) ; m [ 0 ] [ 0 ] = 1.0 / ( s * aspect ) ; m [ 1 ] [ 1 ] = 1.0 / s ; m [ 2 ] [ 2 ] = - far / ( far - near ) ; m [ 2 ] [ 3 ] = - far * near / ( far - near ) ; m [ 3 ] [ 2 ] = - 1.0 ; m }
Returns a perspective matrix for fov degrees and aspect ratio (width / height).
Returns a perspective matrix for fov degrees and aspect ratio ( width / height ) .
fov
f32
aspect
f32
near
f32
far
f32
fov
f32
aspect
f32
near
f32
far
f32