From: Scott Worley Date: Tue, 18 Dec 2012 10:10:03 +0000 (-0800) Subject: Add closed_trianglefan X-Git-Url: http://git.scottworley.com/nt3d/commitdiff_plain/a9f371ff81df6ee1a50d7a0376c278e6b6a16129?ds=sidebyside;hp=a4cc880243177697bfa0a1e9091bfd12a60366ab Add closed_trianglefan --- diff --git a/box_by_trianglefan.html b/box_by_trianglefan.html index 1972560..7d4271b 100644 --- a/box_by_trianglefan.html +++ b/box_by_trianglefan.html @@ -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]]; diff --git a/nt3d.js b/nt3d.js index ae17af1..daa628b 100644 --- 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!");