From 5fb9f8b1bce2f7b8d30f9618b1feee2f261570f8 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 6 Sep 2023 14:18:31 -0700 Subject: [PATCH] tweak matrices --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 924e7ca..b8d66d4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -106,10 +106,10 @@ impl Camera { }else{ self.fov/5.0 }; - let proj = perspective_rh(fov, aspect, 1.0, 200.0); + let proj = perspective_rh(fov, aspect, 0.5, 1000.0); + let proj_inv = proj.inverse(); let view = glam::Mat4::from_translation(self.pos+self.offset) * glam::Mat4::from_euler(glam::EulerRot::YXZ, self.yaw, self.pitch, 0f32); let view_inv = view.inverse(); - let proj_inv = proj.inverse(); let mut raw = [0f32; 16 * 3 + 4]; raw[..16].copy_from_slice(&AsRef::<[f32; 16]>::as_ref(&proj)[..]);