From 7c1f560ae2aea2678c966e685c2cd9968c3e97c3 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Sat, 6 Jun 2020 10:57:07 -0700 Subject: [PATCH] Change fallback unit normal to be in negative y-direction --- manimlib/shaders/get_unit_normal.glsl | 2 +- manimlib/utils/space_ops.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manimlib/shaders/get_unit_normal.glsl b/manimlib/shaders/get_unit_normal.glsl index ed1b975d..d755d458 100644 --- a/manimlib/shaders/get_unit_normal.glsl +++ b/manimlib/shaders/get_unit_normal.glsl @@ -13,7 +13,7 @@ vec3 get_unit_normal(in vec3[3] points){ if(new_cp_norm < tol){ // We only come here if all three points line up // on the z-axis. - return vec3(0.0, 1.0, 0.0); + return vec3(0.0, -1.0, 0.0); // return k_hat; } return new_cp / new_cp_norm; diff --git a/manimlib/utils/space_ops.py b/manimlib/utils/space_ops.py index c28c4224..fb5ce37f 100644 --- a/manimlib/utils/space_ops.py +++ b/manimlib/utils/space_ops.py @@ -4,7 +4,7 @@ import itertools as it from mapbox_earcut import triangulate_float32 as earcut from manimlib.constants import RIGHT -from manimlib.constants import UP +from manimlib.constants import DOWN from manimlib.constants import OUT from manimlib.constants import PI from manimlib.constants import TAU @@ -204,7 +204,7 @@ def get_unit_normal(v1, v2, tol=1e-6): new_cp = cross(cross(v1, OUT), v1) new_cp_norm = get_norm(new_cp) if new_cp_norm < tol: - return UP + return DOWN return new_cp / new_cp_norm return cp / cp_norm