CG 4
CG 4
CG 4
Introduction
– Object space
– Image space
Object space
• Pseudo code…
– for each object in the scene
• determine which parts of object are visible
• draw these parts in the appropriate color
Image space
• Pseudo code…
– for each pixel in the frame buffer
• determine which polygon is closest to the
viewer at that pixel location
• Recursion
Step 1 :
•Choose a polygon arbitrarily from scene.
5
5a
2 5b
•Choose polygon arbitrarily (here 2)
Back Back
Front Front Viewpoint
Viewpoint
Z-Buffer
• Paint the pixel with the color of the polygon whose z value
is the closest to the eye.
Z-Buffer (steps)
• Advantages :
1. It is easy to implement
2. As it processes one object at a time , the
number of objects can be large.
• Disadvantages
1. It requires lots of memory as we are storing
each pixels z-value.
2. It is time consuming as we are comparing
each and every pixel