pub fn viewport(x: f64, y: f64, w: f64, h: f64, depth: f64) -> Matrix {
    let mut vp = Matrix::identity(4);

    vp.put(0, 3, x + w / 2.0);
    vp.put(1, 3, y + h / 2.0);
    vp.put(2, 3, depth / 2.0);

    vp.put(0, 0, w / 2.0);
    vp.put(1, 1, h / 2.0);
    vp.put(2, 2, depth / 2.0);

    vp
}
/// Create a view port centered at x, y, depth, with the given width and height.
Create a view port centered at x, y, depth, with the given width and height.
Create a view port centered at x y depth with the given width and height .
pub fn viewport(x: f64, y: f64, w: f64, h: f64, depth: f64) -> Matrix {
    let mut vp = Matrix::identity(4);
    vp.put(0, 3, x + w / 2.0);
    vp.put(1, 3, y + h / 2.0);
    vp.put(2, 3, depth / 2.0);
    vp.put(0, 0, w / 2.0);
    vp.put(1, 1, h / 2.0);
    vp.put(2, 2, depth / 2.0);
    vp
}
pub fn viewport ( x : f64 , y : f64 , w : f64 , h : f64 , depth : f64 ) -> Matrix { let mut vp = Matrix :: identity ( 4 ) ; vp . put ( 0 , 3 , x + w / 2.0 ) ; vp . put ( 1 , 3 , y + h / 2.0 ) ; vp . put ( 2 , 3 , depth / 2.0 ) ; vp . put ( 0 , 0 , w / 2.0 ) ; vp . put ( 1 , 1 , h / 2.0 ) ; vp . put ( 2 , 2 , depth / 2.0 ) ; vp }
Create a view port centered at x, y, depth, with the given width and height.
Create a view port centered at x y depth with the given width and height .
x
f64
y
f64
w
f64
h
f64
depth
f64