update projection matrix representation and update dependencies

This commit is contained in:
Hartmut Seichter 2022-12-19 16:26:53 +01:00
parent 736e1c46a3
commit ffed77a2fc
2 changed files with 56 additions and 50 deletions

View file

@ -54,12 +54,18 @@ pub fn make_projection_rh_from_frustum_reversed(
let c = z_near / (z_far - z_near);
let d = z_far * z_near / (z_far - z_near);
let sx = 2.0 * z_near / (right - left);
let sy = 2.0 * z_near / (top - bottom);
//
Mat4::from_cols(
Vec4::new(2.0 * z_near / (right - left), 0.0, 0.0, 0.0),
Vec4::new(0.0, 2.0 * z_near / (top - bottom), 0.0, 0.0),
Vec4::new(sx, 0.0, 0.0, 0.0),
Vec4::new(0.0, sy, 0.0, 0.0),
Vec4::new(a, b, c, -1.0),
Vec4::new(0.0, 0.0, d, 0.0),
)
}
pub fn make_projection_rh_custom(fov_y: f32, aspect_ratio: f32, z_near: f32, z_far: f32) -> Mat4 {