]> git.scottworley.com Git - nt3d/blame_incremental - box_by_faces.html
Explicitly bounds-check in angle_between()
[nt3d] / box_by_faces.html
... / ...
CommitLineData
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) {
7 var origin = [0, 0, 0 ];
8 var x = [size, 0, 0 ];
9 var y = [0, size, 0 ];
10 var z = [0, 0, size];
11 var xy = [size, size, 0 ];
12 var xz = [size, 0, size];
13 var yz = [0, size, size];
14 var xyz = [size, size, size];
15 return [].concat(
16 nt3d.quad(origin, y, xy, x), // bottom (near xy face)
17 nt3d.quad(origin, x, xz, z), // near xz face
18 nt3d.quad(origin, z, yz, y), // near yz face
19 nt3d.quad(y, yz, xyz, xy), // far xz face
20 nt3d.quad(x, xy, xyz, xz), // far yz face
21 nt3d.quad(z, xz, xyz, yz)); // top (far xy face)
22 }
23 var params = [["Size", 1]];
24 </script>
25 </head>
26 <body onload="nt3d.framework(box_by_faces, params)">
27 <h1>Box by faces</h1>
28 <p>Make a box by the most straightforward method: specify the six faces.</p>
29 </body>
30</html>