From 7d47b7f1fd16df6516c407eff8c2a7633c93849f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Gallus?= Date: Tue, 8 Mar 2022 01:29:35 +0100 Subject: [PATCH 1/2] Fix a bug in glm_lookat_lh Fix the order of arguments passed to glm_vec3_crossn to avoid the negation of X axis. --- include/cglm/clipspace/view_lh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cglm/clipspace/view_lh.h b/include/cglm/clipspace/view_lh.h index 48324f1..9d726cf 100644 --- a/include/cglm/clipspace/view_lh.h +++ b/include/cglm/clipspace/view_lh.h @@ -37,7 +37,7 @@ glm_lookat_lh(vec3 eye, vec3 center, vec3 up, mat4 dest) { glm_vec3_sub(center, eye, f); glm_vec3_normalize(f); - glm_vec3_crossn(f, up, s); + glm_vec3_crossn(up, f, s); glm_vec3_cross(s, f, u); dest[0][0] = s[0]; From 7e211e1f49c4d915074a149017ae5b7efb91fded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Gallus?= Date: Tue, 8 Mar 2022 01:42:43 +0100 Subject: [PATCH 2/2] Fix bug in view_lh.h #2 Reverse order of parameters in the second crossproduct --- include/cglm/clipspace/view_lh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cglm/clipspace/view_lh.h b/include/cglm/clipspace/view_lh.h index 9d726cf..5667694 100644 --- a/include/cglm/clipspace/view_lh.h +++ b/include/cglm/clipspace/view_lh.h @@ -38,7 +38,7 @@ glm_lookat_lh(vec3 eye, vec3 center, vec3 up, mat4 dest) { glm_vec3_normalize(f); glm_vec3_crossn(up, f, s); - glm_vec3_cross(s, f, u); + glm_vec3_cross(f, s, u); dest[0][0] = s[0]; dest[0][1] = u[0];