algorithm for z-buffer methoda initialize


Algorithm for Z-Buffer Method

(a)  Initialize every pixel in the viewport to the smallest value of z, namely z0 the z-value of the rear clipping plane or "back-ground". Store all values in the z-buffer. 

 (b)  Start polygon loop i = 1 to n, n being the number of polygons.

(i)  Scan convert each pixel, that is, find the value of z for each (x, y) for the polygon.

(ii) Compare it with the z′ value stored for that (x, y). If z < z′, then the new point is closer to the viewer than the previous point, and hence is visible in front of the previous point; reset z′ to the new value.

(c)  End loop on i.

(d)  Plot only the final z′ values in the z-buffer for all (x, y) in the viewport, with the appropriate colour or gray scale and other attributes.

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: algorithm for z-buffer methoda initialize
Reference No:- TGS0326626

Expected delivery within 24 Hours