demo_vk/graphics/
mod.rs

1pub mod vulkan;
2
3use nalgebra::Matrix4;
4
5pub fn ortho_projection(aspect: f32, height: f32) -> Matrix4<f32> {
6    let w = height * aspect;
7    let h = height;
8    #[rustfmt::skip]
9    let projection = Matrix4::new(
10        2.0 / w,  0.0,     0.0, 0.0,
11        0.0,     -2.0 / h, 0.0, 0.0,
12        0.0,      0.0,     1.0, 0.0,
13        0.0,      0.0,     0.0, 1.0,
14    );
15    projection
16}