Page 49 - Computer Graphics
P. 49

48

               bottom  producing an active edge list for each scan line crossing the polygon
                                                                   BC
               boundaries. The active edge list for a scan line contains all edges crossed by that
               scan line. The figure (d) shows sorted edges of the polygon with active edges.



                                                                   BA

                                                                   DC
                            B      D                               DE
                              C                                    AJ          Top

                  A                              G                 BC
                                        E                                                        Active
                                                        Scan line     GF                         edges

                                             F
                                                          H
                                                                   GH
                   J                                     I                        Bottom
                                                                   EF
                                                                   HI
                                                                   JI



                                   Fig. (d) Sorted edges of the polygon with active edges


               A scan line algorithm for filling a polygon begins by ordering the polygon sides

               on the largest y value. It begins with the largest y value and scans down the
               polygon. For each y, it determines which sides can be intersected and finds the x
               values of these intersection points. It then sorts, pairs and passes these x values
               to a line drawing routine.
   44   45   46   47   48   49   50   51   52   53   54