From 377b0016211ddebc521a0ee784774d85118de2b0 Mon Sep 17 00:00:00 2001 From: Yousif Date: Mon, 26 Feb 2024 11:20:23 +0100 Subject: [PATCH] Fix `perspective_reversed_z_vk` for `lh_yup` and `rh_yup` (#168) --- src/projection/lh_yup.rs | 2 +- src/projection/rh_yup.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/projection/lh_yup.rs b/src/projection/lh_yup.rs index 59ab17b..42b602d 100644 --- a/src/projection/lh_yup.rs +++ b/src/projection/lh_yup.rs @@ -290,7 +290,7 @@ pub fn perspective_reversed_z_vk( Mat4::new( Vec4::new(sx, 0.0, 0.0, 0.0), Vec4::new(0.0, -sy, 0.0, 0.0), - Vec4::new(0.0, 0.0, z_far / nmf, 1.0), + Vec4::new(0.0, 0.0, z_near / nmf, 1.0), Vec4::new(0.0, 0.0, -z_near * z_far / nmf, 0.0), ) } diff --git a/src/projection/rh_yup.rs b/src/projection/rh_yup.rs index ddee91b..9384ae5 100644 --- a/src/projection/rh_yup.rs +++ b/src/projection/rh_yup.rs @@ -295,7 +295,7 @@ pub fn perspective_reversed_z_vk( Mat4::new( Vec4::new(sx, 0.0, 0.0, 0.0), Vec4::new(0.0, -sy, 0.0, 0.0), - Vec4::new(0.0, 0.0, z_far / nmf, -1.0), + Vec4::new(0.0, 0.0, -z_near / nmf, -1.0), Vec4::new(0.0, 0.0, -z_near * z_far / nmf, 0.0), ) }