Graphics Reference
In-Depth Information
Figure 3.2: A different Dürer rendering approach.
Inline Exercise 3.2: Imagine that, instead of moving the pointer at the end of
the string to points on the lute and then seeing where they pass through the
paper, the two men start with a piece of graph paper. For each square on
the graph paper, the man with the pencil holds it at the center of the square; the
shutter is then opened, and the man with the pointer moves it so that the string
passes by the pencil point and so that the end of the string is touching either
the lute, or the table, or the wall. The object being touched is noted, and when
the shutter is closed again, the man with the pencil fills in the grid square
with some amount of pencil-shading, corresponding to how dim or bright the
touched point looks: If it appears dark, the grid square is filled in completely. If
it's light, the grid square is left empty. If it's somewhere between light and dark,
the grid square is shaded a light grey tone. Think for yourself for a moment
about what kind of picture this produces. This approach (working “per pixel”
and finding out what's seen through that pixel) is the essence of ray tracing,
as discussed in Chapter 14. A slightly different version of this approach, also
developed by Dürer, is shown in Figure 3.2: The graph paper is on the table; the
corresponding grid in the shutter consists of wires stretched across the shutter,
or semitransparent graph paper, and the string and pointer are replaced by the
line of sight through a small hole in front of the artist.
The renderings produced by the string-and-pointer method and the graph-
paper method are quite different. The first produces an outline of the shapes in
the scene (provided the first man chooses his points wisely). The second ignores
the scene completely in choosing what to draw, and merely assigns a grayscale
value to each grid square. In the event that the scene is very simple—that there
are few outlines in the scene—the first method is quite fast. If the scene is very
complex (imagine it consists of a bowl full of spaghetti!), then the second method,
with its fixed number of grid squares, is faster. Of course, it's only faster because
we can, in the physical world, determine which point is visible instantaneously,
which we'll discuss further in the next section. In general, though, many tech-
niques in graphics involve tradeoffs that are determined by scene complexity; this
is just the first we've encountered.
Now that we have an understanding of this basic rendering process, how can
we modernize it so that it becomes useful in computer graphics? We'll focus on
creating the drawing, or, more accurately, we'll create a program that models this
 
 
Search WWH ::




Custom Search