HTML and CSS Reference
In-Depth Information
}());
};
</script>
</body>
</html>
Modeling 3D solids
In the computing world, the first example in any book or tutorial is almost always “Hello, World!”, a program
that in one way or another prints the words to the screen. When drawing your first 3D solid, the equivalent
seems to be a spinning cube, so let's start with that.
Modeling a spinning cube
To model a cube, you need eight points to define its eight corners. These are shown in Figure 16-13.
5
4
0
1
7
6
3
2
Figure 16-13. The points of a 3D cube
The position of the points are defined like this for our code:
//front four corners
points[0] = new Point3d(-100, -100, -100);
points[1] = new Point3d( 100, -100, -100);
points[2] = new Point3d( 100, 100, -100);
points[3] = new Point3d(-100, 100, -100);
//back four corners
points[4] = new Point3d(-100, -100, 100);
points[5] = new Point3d( 100, -100, 100);
 
Search WWH ::




Custom Search