Skip to content

Commit 917182d

Browse files
committed
fix triangle-vertex getOrthogonalVector for small vectors
1 parent 4908a99 commit 917182d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/triangle-vertex.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ vec3 getOrthogonalVector(vec3 v) {
2828
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
2929
// Assign z = 0, x = -b, y = a:
3030
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
31-
if (v.x*v.x > 0.1 || v.y*v.y > 0.1) {
31+
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
3232
return normalize(vec3(-v.y, v.x, 0.0));
3333
} else {
3434
return normalize(vec3(0.0, v.z, -v.y));

0 commit comments

Comments
 (0)