Graphics Reference
In-Depth Information
The numbers show the color numbers associated to the indicated regions. We start
by associating the colors gray and red to 1 and 2, respectively, and black to all the
other numbers. For the second frame we change 2 to black and 3 to red. For the
third frame, we change 3 to black and 4 to red, and so on. In this way, making
the ith ball the red ball as i changes from 2 to 6 and then from 6 back to 2, the
ball will appear to bounce.
(2) Animation using color cycling and bit plane extraction:
Color cycling means that if we have a color table T with n entries, then we keep
changing the colors of items via the instructions
[] =
[]
[ ] =
[]
[
] =
[]
[ ] =-
[
]
[ ] =
[]
T
2
:
T
1
;
T
3
:
T
2
;...
Ti
+
1
:
Ti
;...
Tn
:
Tn
1
;
T
1
:
Tn
;
If the colors in the image are designed appropriately, then these changes can create
the illusion of motion.
Bit plane extraction relies on the fact that individual bits of a pixel can be
thought of as corresponding to individual image bit planes. Frame buffers are then
just a collection of k bit planes, where k is the number of bits in a pixel. See Figure
2.25. One trick we can now play is to create k different image frames with each
frame using a subset of all colors. Then animation can be achieved by setting the
lookup values for all values except the current frame value to the background
color. Such updating of lookup values causes the picture to cycle through the
frames. For example, assume that we have 3 bit pixels. We first set all color
numbers except 4 to black, then we set all color numbers except 2 to black, and
finally we set all color numbers except 1 to black. This will cycle through three
single color images.
(3) Animation using the pan and zoom features:
One divides the frame buffer into k smaller areas. Typical values for k are 4 and
16. Next, one creates a reduced resolution image for a frame of animation in
each area. The animation is produced by zooming each area appropri-
Figure 2.25.
The bit planes of a
frame buffer.
Search WWH ::




Custom Search