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(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];
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)
23 var params = [["size",
1]];
26 <body onload=
"nt3d.framework(box_by_faces, params)">
28 <p>Make a box by the most straightforward method: specify the six faces.
</p>