Sie sind auf Seite 1von 4

1-2 HOW THE INTERACTIVE-GRAPHICS DISPLAY WORKS

The modern graphics display is extremely simple in construction. It consists


of three components: a digital memory, or frame buffer, in which the
displayed image is stored as a matrix of intensity values; a television monitor,
i.e., a home TV set without the tuning and receiving electronics; and a simple
interface, called the display controller, that passes the contents of the frame
buffer to the monitor. The image must be passed repeatedly to the monitor,
30 or more times a second, in order to maintain a steady picture on the
screen.
Inside the frame buffer the image is stored as a pattern of binary digital
numbers, which represent a rectangular array of picture elements, or pixels.
In the simplest case, where we wish to store only black-and-white images,
we can represent black pixels by Is in the frame buffer, and white pixels by
Os. Thus a 16 X 16 array of black and white pixels could be represented by
the binary values stored in the 32 8-bit bytes shown in Figure 1-5 (a byte is
an 8-bit binary unit of digital data).

The display controller simply reads each successive byte of data from the
frame buffer and converts its Os and Is into the corresponding video signal.
This signal is then fed to the TV monitor, producing a black-and-white
pattern on the screen, like the wheel shown in Figure 1-6. The display
controller repeats this operation 30 times a second and thus maintains a
steady picture on the TV screen.
Suppose we wish to change the displayed picture. All we need do is modify
the frame buffer’s contents to represent the new pattern of pixels. In this way
we can achieve such effects as a rotating wheel or a wheel that grows and
shrinks.
We can now see how the ping-pong game might be programmed. Each of
the sixteen possible positions of the right-hand paddle could be displayed by
a different set of bit patterns; some of these are shown in Figure 1-7. The
computer reads the position of the right-hand control lever and selects the
appropriate pattern, substituting it for the right-hand column of 16 bytes in
the frame buffer. It does the same for the left-hand lever and the left-hand
column of the frame buffer. The position of the “ball” is computed, and the
appropriate bits are set to 1 in the frame buffer. This entire process is
repeated over and over again; meanwhile the display controller continues to
pass the contents of the frame buffer to the TV monitor to maintain the
moving picture on the screen.

The display controller simply reads each successive byte of data from the
frame buffer and converts its Os and Is into the corresponding video signal.
This signal is then fed to the TV monitor, producing a black-and-white
pattern on the screen, like the wheel shown in Figure 1-6. The display
controller repeats this operation 30 times a second and thus maintains a
steady picture on the TV screen.
Suppose we wish to change the displayed picture. All we need do is modify
the frame buffer’s contents to represent the new pattern of pixels. In this way
we can achieve such effects as a rotating wheel or a wheel that grows and
shrinks.
We can now see how the ping-pong game might be programmed. Each of
the sixteen possible positions of the right-hand paddle could be displayed by
a different set of bit patterns; some of these are shown in Figure 1-7. The
computer reads the position of the right-hand control lever and selects the
appropriate pattern, substituting it for the right-hand column of 16 bytes in
the frame buffer. It does the same for the left-hand lever and the left-hand
column of the frame buffer. The position of the “ball” is computed, and the
appropriate bits are set to 1 in the frame buffer. This entire process is
repeated over and over again; meanwhile the display controller continues to
pass the contents of the frame buffer to the TV monitor to maintain the
moving picture on the screen.

1-3 SOME COMMON QUESTIONS


It should be pointed out, in fairness to those who have spent years of effort
and millions of dollars of research money on computer graphics, that there
is a great deal more to interactive graphics than the preceding example
suggests. Some readers will already have questions about this example. The
following are some of the more frequently asked questions about
interactive graphics.

How Do We Display Straight Lines? How Are Curves Drawn on the


Display?
The wheel picture in Figure 1-6 illustrates two of the problems in drawing
curved and straight lines on a graphic display. First, we must choose which
pixels should be black and which white; the choice is not always
straightforward. Second, slanting lines and curves in our image will be far
from smooth and will instead show unpleasant “staircase” effects.
The first problem is solved by using a procedure, or algorithm, that computes
which pixels should be black from the equation of the line or curve. A
number of such algorithms have been developed, some of which are
described in the next chapter. Most of these algorithms are so simple that
they can easily be implemented in hardware, leading to very fast line and
curve generation.
The second problem of staircaselike quantization effects in the picture is much
more difficult to solve. The most common solution is to use a different sort of
display, called a line-drawing display, which plots continuous lines and curves
rather than separate pixels. With a line-drawing display it is possible to draw
lines that appear completely smooth to the unaided eye.
Until recently, line-drawing displays were the only widely used type of
graphic display; the cost of digital memories made the frame buffer too
expensive to consider. Although this situation is now changing, most
computer graphics research has been oriented toward line-drawing displays;
the frame buffer and its effective use are relatively unexplored topics.

Das könnte Ihnen auch gefallen