]> git.scottworley.com Git - nt3d/blob - box_by_trianglefan.html
1972560b4f9beae2b6592a208bb4e43db3ba691e
[nt3d] / box_by_trianglefan.html
1 <html>
2 <head>
3 <title>Box by trianglefan</title>
4 <script type="text/javascript" src="nt3d.js"></script>
5 <script type="text/javascript">
6 function box_by_trianglefan(size_as_string) {
7 var size = parseFloat(size_as_string);
8 var origin = [0, 0, 0 ];
9 var x = [size, 0, 0 ];
10 var y = [0, size, 0 ];
11 var z = [0, 0, size];
12 var xy = [size, size, 0 ];
13 var xz = [size, 0, size];
14 var yz = [0, size, size];
15 var xyz = [size, size, size];
16 return [].concat(
17 nt3d.trianglefan([origin, x, xz, z, yz, y, xy, x]),
18 nt3d.trianglefan([xyz, yz, z, xz, x, xy, y, yz]));
19 }
20 var params = [["Size", 1]];
21 </script>
22 </head>
23 <body onload="nt3d.framework(box_by_trianglefan, params)">
24 <h1>Box by trianglefan</h1>
25 <p>Make a box with two triangle fans from opposite corners.</p>
26 </body>
27 </html>