mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Change fallback unit normal to be in negative y-direction
This commit is contained in:
parent
98ac6a06f2
commit
7c1f560ae2
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue