pub fn orthographic(left: f32, right: f32, top: f32, bottom: f32, znear: f32, zfar: f32) -> Mat4f {
    let mut mat = Mat4f::zeros();

    mat[(0, 0)] = 2. / (right - left);
    mat[(1, 1)] = 2. / (bottom - top);
    mat[(2, 2)] = -1. / (zfar - znear);
    mat[(0, 3)] = (right + left) / (right - left);
    mat[(1, 3)] = -(bottom + top) / (bottom - top);
    mat[(2, 3)] = -znear / (zfar - znear);
    mat[(3, 3)] = 1.;

    mat
}
/// Create a right handed ortho projection matrix.
Create a right handed ortho projection matrix.
Create a right handed ortho projection matrix .
pub fn orthographic(left: f32, right: f32, top: f32, bottom: f32, znear: f32, zfar: f32) -> Mat4f {
    let mut mat = Mat4f::zeros();
    mat[(0, 0)] = 2. / (right - left);
    mat[(1, 1)] = 2. / (bottom - top);
    mat[(2, 2)] = -1. / (zfar - znear);
    mat[(0, 3)] = (right + left) / (right - left);
    mat[(1, 3)] = -(bottom + top) / (bottom - top);
    mat[(2, 3)] = -znear / (zfar - znear);
    mat[(3, 3)] = 1.;
    mat
}
pub fn orthographic ( left : f32 , right : f32 , top : f32 , bottom : f32 , znear : f32 , zfar : f32 ) -> Mat4f { let mut mat = Mat4f :: zeros ( ) ; mat [ ( 0 , 0 ) ] = 2. / ( right - left ) ; mat [ ( 1 , 1 ) ] = 2. / ( bottom - top ) ; mat [ ( 2 , 2 ) ] = - 1. / ( zfar - znear ) ; mat [ ( 0 , 3 ) ] = ( right + left ) / ( right - left ) ; mat [ ( 1 , 3 ) ] = - ( bottom + top ) / ( bottom - top ) ; mat [ ( 2 , 3 ) ] = - znear / ( zfar - znear ) ; mat [ ( 3 , 3 ) ] = 1. ; mat }
Create a right handed ortho projection matrix.
Create a right handed ortho projection matrix .
left
f32
right
f32
top
f32
bottom
f32
znear
f32
zfar
f32
left
f32
right
f32
top
f32
bottom
f32
znear
f32
zfar
f32