Page 167 - DCAP504_Computer Graphics
P. 167
Computer Graphics
if any member of P2 does not obscure P1, draw P1 and remove it
if any member of P2, say Q, obscures P1, swap P1 with Q
tag Q
if Q is already tagged, use the plane containing P1 to separate Q into polygons Q1 and Q2
eliminate Q from the polygon list
include Q1 and Q2 in the polygon list in z-sorted manner
(d) end
5. end
Advantages of Painter’s Algorithm
The advantages of painter’s algorithm are that
1. It is based on the divide and conquer strategy. Therefore, parallel computers can be used to speed
up the process.
2. It does not use extra memory buffer.
11.4 Warnock Algorithm
The Warnock algorithm also known as the area subdivision method is an image space method but it
makes use of the object space method for depth comparison. It also makes use of area coherence. This
method tries to get the display right instead of deciding exactly what is happening in the scene. It is a
resolution dependent method. As the resolution of the display increases, the amount of computation
also increases.
According to this method, the viewport area is divided into smaller areas. This division is done until
every small area contains a polygon projected on viewport area. As soon as the area (pixel) becomes
small, the dividing process stops.
This algorithm helps to decide which projected polygon surface overlaps a given area on the screen and
is therefore a possible candidate for visibility in this area. In second part of the algorithm all those
potential candidates are again tested to find out which one will be completely visible and can be
displayed. The given rectangular area or samples are further subdivided if entire polygonal surface is
not visible.
As the resolution of the display increases, the amount of computation also increases.
Algorithm
1. Initialize the area to be subdivided as the given viewport.
2. Sort the polygon according to the minimum depth value.
3. Create a visible polygon list.
4. Apply the following tests for the visibility of the polygon, if it satisfies the following condition:
(a) If all the polygons forming an object on screen fall outside, then set -
The sampling area with background color.
(b) If a single polygon is present in the sampling area, then draw-
The polygon with desired intensity values provided for each internal pixel.
(c) If a single polygon is present in the probable visible list, then color-
The entire sample area by intensity values of each pixel on the polygon.
160 LOVELY PROFESSIONAL UNIVERSITY