From 1147d02c20edeb1555d9fce148e7366e01fd0a74 Mon Sep 17 00:00:00 2001 From: Brett Date: Sat, 11 Feb 2023 12:07:03 -0500 Subject: [PATCH] Another perspective change --- include/blt/std/math.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/blt/std/math.h b/include/blt/std/math.h index 7ca161e..005768e 100644 --- a/include/blt/std/math.h +++ b/include/blt/std/math.h @@ -513,13 +513,13 @@ namespace blt { static inline mat4x4 perspective(float fov, float aspect_ratio, float near, float far){ mat4x4 perspectiveMat4x4; - float oneOverFarMNear = 1.0f / (far - near); + float oneOverNearMFar = 1.0f / (near - far); float halfTan = tanf(fov * 0.5f * (float)M_PI / 180.0f); perspectiveMat4x4.m00(1.0f/(aspect_ratio*halfTan)); perspectiveMat4x4.m11(1.0f/halfTan); - perspectiveMat4x4.m22(-(far + near) * oneOverFarMNear); - perspectiveMat4x4.m32(-2 * far * near * oneOverFarMNear); + perspectiveMat4x4.m22((far + near) * oneOverNearMFar); + perspectiveMat4x4.m32(2 * far * near * oneOverNearMFar); perspectiveMat4x4.m23(-1); perspectiveMat4x4.m33(0);