SCAN-LINE METHOD






                                   This image space method for removing hidden surface5 is an extension of the scan-line algorithm for tilling polygon interiors. rather than filling only one surface, we now handle multiple surfaces. As each scan line is processed, all polygon surfaces intersecting that line are examined to see which are visible. Across each scan line, depth calculations are made for every overlapping surface to see which is nearest to the view plane. When the visible surface has been determined, the intensity value for that position is entered into the refresh buffer.

We assume that tables are-set up for the varied surfaces, as discussed in Chapter 10, which include both a grip table and a polygon table. the sting table contains coordinate endpoints for every line in-the scene, the inverse slope of every line, and pointers into the polygon table to spot the surfaces bounded by each line. The polygon table contains coefficients of the plane equation for every surface, intensity information for the surfaces, and possibly pointers into the sting table. To facilitate the look for surfaces crossing a given scan line, we are able to founded a full of life list of edges from information within the edge table. This active list will contain only edges that cross the present scan line, sorted so as of skyrocketing x. additionally, we define a flag for every surface that's assault or off to point whether an edge along a scan line is inside or outside of the surface. Scan lines are processed from left to right. At the leftmost boundary of a surface, the surface flag is turned on; and at the rightmost boundary, it's turned off.

The active list for scan line 1 contains information from the sting table for edges AB, BC, EH, and FG. For positions along this scan line between edges AB and BC, only the flag for surface Sl is on. Therefore, no depth calculations are necessary, and intensity information for surface S, is entered from the polygon table into the refresh buffer. Similarly, between edges EH and FG, only the flag for surface S2 is on. NO other positions along scan line 1 intersect surfaces, that the intensity values within the other areas are set to the background intensity. The background intensity are often loaded through- out the buffer in an initialization routine.

For scan lines 2 and three, the active edge list contains edges AD, EH, BC, and FG. Along scan line 2 from edge AD to edge EH, only the flag for surface S, is on. But between edges EH and BC, the flags for both surfaces are on. during this interval, depth calculations must be made using the plane coefficients for the 2 surfaces. For this instance, the depth of surface SI is assumed to be but that of S2, so intensities for surface S, are loaded into the refresh buffer until boundary BC is encountered. Then the flag for surface SI cracks, and intensities for surface S2 are stored until edge FG is passed.

We can make the most of-coherence along the scan lines as we pass from one scan line to the subsequent. Scan line 3 has the identical active list of edges as scan line 2. Since no changes have occurred in line intersections, it's unnecessary again to form depth calculations between edges EH and BC. the 2 surfaces must be within the same orientation as determined on scan line 2, that the intensities for surface S, are often entered without further calculations. Any number of overlapping polygon surfaces are often processed with this scan-line method. Flags for the surfaces are set to point whether an edge is inside or outside, and depth calculations are performed when surfaces overlap. When these coherence methods are used, we'd like to use caution to stay track of which surface section is visible on each scan line. This works providing surfaces don't traverse or otherwise cyclically overlap one another if any reasonably cyclic overlap is present during a scene, we are able to divide the surfaces to eliminate the overlaps. The dashed lines during this figure indicate where planes may be subdivided to make two distinct surfaces, so the cyclic overlaps are eliminated.

Comments

POPULAR POSTS

POPULAR POSTS