Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Random lines are cool for demonstration purposes, but there's no reason you can't impose a bit of order on that mess. All it takes is getting rid of the initial loop that creates random x, y, and z values for those points and replacing it with some specific, predetermined values. For example, let's make a square. Figure 16-3 shows the square you'll draw and the 3D locations of its four corners.