HTML and CSS Reference
In-Depth Information
points[6] = new Point3d( 100, 100, 100);
points[7] = new Point3d(-100, 100, 100);
Then, you need to define the triangles. Each face of the cube consists of two triangles, so there are 12
triangles altogether—two each for the six faces. Again, we list the points for each triangle in a clockwise
direction, as seen from the outer face of the triangle. It gets a little tricky, but rotate the cube in your mind
so that the triangle you're defining is facing you, and then list the points in clockwise order from that
viewpoint. For example, the front face is easy, and Figure 16-14 shows the two triangles. While continuing
to rotate the cube in your mind, you can see the top face in Figure 16-15, and Figure 16-16 shows the
back.
0
1
0, 1, 2
0, 2, 3
3
2
Figure 16-14. The front face of the cube
4
5
0, 4, 5
0, 5, 1
0
1
Figure 16-15. The top face of the cube
Search WWH ::




Custom Search