
CHAPTER 2 ■ SETTING UP DIFFERENT CAMERA MODES IN YOUR 3D WORLD
37
Figure 2-3. Multiple objects competing for the same pixel
However,ifobjectBgetsdrawnfirst,thecorrespondingpixelintheframebufferwillbe
assignedthecolorofobjectBfirst.Atthenextmoment,objectAisdrawn,andnow,thegraph-
icscarddecideswhetherthepixelneedstobeoverwrittenbythecolorofobjectA.
To solve this problem, inside the graphics card a second image is stored, with the same
size as the window. At the moment a color is assigned to a pixel of the frame buffer, the dis-
tancebetweenthecameraandtheobjectisstoredinthissecondimage.Thisdistanceisa ...