Determine the algorithm for z-buffer method, Data Structure & Algorithms

Assignment Help:

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.

 


Related Discussions:- Determine the algorithm for z-buffer method

Travelling salesman problem, Example 3: Travelling Salesman problem G...

Example 3: Travelling Salesman problem Given: n associated cities and distances among them Find: tour of minimum length that visits all of city. Solutions: How several

Define an array, Define an array. Array is made up of same data structu...

Define an array. Array is made up of same data structure that exists in any language. Array is set of same data types. Array is the collection of same elements. These same elem

A full binary tree with 2n+1 nodes, A full binary tree with 2n+1 nodes have...

A full binary tree with 2n+1 nodes have n non-leaf nodes

How to measure the algorithm efficiency, How to measure the algorithm's eff...

How to measure the algorithm's efficiency? It is logical to examine the algorithm's efficiency as a function of some parameter n showing the algorithm's input size. Instance

Lists, In the previous unit, we have discussed arrays. Arrays are data stru...

In the previous unit, we have discussed arrays. Arrays are data structures of fixed size. Insertion and deletion involves reshuffling of array elements. Thus, array manipulation

Implement stack using two queues, How To implement stack using two queues ,...

How To implement stack using two queues , analyze the running time of the stack operations ?

Project, human resource management project work in c++

human resource management project work in c++

Explain critical path and chain, 1.  Using the traditional method of CPM: ...

1.  Using the traditional method of CPM: a.  What activities are on the critical path? b.  What is the expected total lead time of the project? 2.  Using CCPM: a.  What

Efficient way of storing a sparse matrix in memory, Explain an efficient wa...

Explain an efficient way of storing a sparse matrix in memory.   A matrix in which number of zero entries are much higher than the number of non zero entries is called sparse mat

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd