Chapter 6. Hidden-Line Elimination
Traditionally, engineers who want to display three-dimensional objects use line drawings, with black lines on white paper. Although line drawings might look rather dull compared with colored representations of such objects, there are many technical applications for which they are desired. We will now produce exactly the set of line segments that appear in the final result, so we will not put any pixels on the screen that we overwrite later, as we will do in Chapter 7. An advantage of this approach is that this set can also be used for output on a printer or a plotter. Since each of these line segments will be specified only by its endpoints, the possibly limited resolution of our computer screen does not affect the representation of the lines on the printer or plotter; in other words, these lines are of high quality. By using HP-GL (short for Hewlett-Packard Graphics Language) as our file format, we will be able to import the files we produce in text processors such as Microsoft Word. Still better, we can use drawing programs such as CorelDraw to read these files and then enhance the graphics results, for example, by adding text and changing the line type and thickness, before we import them into our documents. In this book, most line drawings of 3D objects have been produced in this way.
LINE SEGMENTS AND TRIANGLES
Although the faces of the objects we are dealing with can be polygons with any number of vertices, we will triangulate these polygons ...
Get Computer Graphics for Java Programmers, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.