]> git.scottworley.com Git - nt3d/commitdiff
Add closed_trianglefan
authorScott Worley <ScottWorley@ScottWorley.com>
Tue, 18 Dec 2012 10:10:03 +0000 (02:10 -0800)
committerScott Worley <ScottWorley@ScottWorley.com>
Tue, 18 Dec 2012 10:10:03 +0000 (02:10 -0800)
box_by_trianglefan.html
nt3d.js

index 1972560b4f9beae2b6592a208bb4e43db3ba691e..7d4271b5c6e6892fa191d8b30972337919f8885a 100644 (file)
@@ -14,8 +14,8 @@
         var yz     = [0,    size, size];
         var xyz    = [size, size, size];
        return [].concat(
-         nt3d.trianglefan([origin, x, xz, z, yz, y, xy, x]),
-         nt3d.trianglefan([xyz, yz, z, xz, x, xy, y, yz]));
+         nt3d.closed_trianglefan([origin, x, xz, z, yz, y, xy]),
+         nt3d.closed_trianglefan([xyz, yz, z, xz, x, xy, y]));
       }
       var params = [["Size", 1]];
     </script>
diff --git a/nt3d.js b/nt3d.js
index ae17af1a01225f486e8fd1bb3cddb7d4ce2b910c..daa628b4c2bd5cfc79483dc9a1a8959e3da195e2 100644 (file)
--- a/nt3d.js
+++ b/nt3d.js
@@ -30,6 +30,9 @@ nt3d = {
                }
                return result;
        },
+       closed_trianglefan: function(fan) {
+               return nt3d.trianglefan(fan.concat([fan[1]]));
+       },
        quadstrip: function(strip) {
                if (strip.length % 2 != 0) {
                        alert("quadstrip length not divisble by 2!");