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