From ff9574ca40a37f3d102855b84affc87383aa2a83 Mon Sep 17 00:00:00 2001
From: Neil Gershenfeld <gersh@cba.mit.edu>
Date: Thu, 16 Jan 2020 14:29:52 -0500
Subject: [PATCH] tilted top broken

---
 modules/mesh/height map | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/mesh/height map b/modules/mesh/height map
index 2627d30..bcad4bc 100644
--- a/modules/mesh/height map	
+++ b/modules/mesh/height map	
@@ -408,6 +408,11 @@ function map_worker() {
          offset += 4
          offset += 2
          //
+         // check normal if needs to be drawn
+         //
+         if (((x1-x0)*(y1-y2)-(x1-x2)*(y1-y0)) >= 0)
+            continue
+         //
          // quantize image coordinates
          //
          x0 = Math.floor((w-1)*(x0-xmin)/(xmax-xmin))
@@ -417,11 +422,6 @@ function map_worker() {
          y1 = Math.floor((h-1)*(y1-ymin)/(ymax-ymin))
          y2 = Math.floor((h-1)*(y2-ymin)/(ymax-ymin))
          //
-         // check normal if needs to be drawn
-         //
-         if (((x1-x0)*(y1-y2)-(x1-x2)*(y1-y0)) >= 0)
-            continue
-         //
          // sort projection order
          //
          if (y1 > y2) {
-- 
GitLab