]> git.scottworley.com Git - nt3d/blob - box_by_faces.html
1a88d8c2b434be57ee3ce26a91da03f6e1dcc12a
[nt3d] / box_by_faces.html
1 <html>
2 <head>
3 <title>Box by faces</title>
4 <script type="text/javascript" src="nt3d.js"></script>
5 <script type="text/javascript">
6 function box_by_faces(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.quad(origin, y, xy, x), // bottom (near xy face)
18 nt3d.quad(origin, x, xz, z), // near xz face
19 nt3d.quad(origin, z, yz, y), // near yz face
20 nt3d.quad(y, yz, xyz, xy), // far xz face
21 nt3d.quad(x, xy, xyz, xz), // far yz face
22 nt3d.quad(z, xz, xyz, yz)); // top (far xy face)
23 }
24 var params = [["Size", 1]];
25 </script>
26 </head>
27 <body onload="nt3d.framework(box_by_faces, params)">
28 <h1>Box by faces</h1>
29 <p>Make a box by the most straightforward method: specify the six faces.</p>
30 </body>
31 </html>