You are on page 1of 6

COMPUTER GRAPHICS

NAME:
HUSNAIN IQBAL

SECTION:
A

ASSIGNMENT #:
2

ROLL NUM:
UW-18-CS-BS-042

SUBMITTED TO:
MAM MUNAZZA BIBI

DATE:
29-03-2021

UNIVERSTY OF WAH
QNo.1 Consider the polygon shown below. Use the Scan Line Algorithm for polygon filling and fill the
respective tables for each iteration.
Polygon vertices = {A, B, C, D, E, F, G}

All Edge Table :

Global Edge Table:


Scan line =5
 Scan Line = y- min
 Y min = 5
 Scan line = 5
 Now initialize Active Edge table

Scan line =6
 Y-max=6 (not found in Active Edge table)
 X+1/m

Scan line =7
 Y-max=7 (found in AET)
 Delete rows from AET with y-max=7
 Y-min=7 (found in GET)
 Replace y-min=7 row from GET in AET
 X+1/m
Scan line=8
 Y-max=8 (not found in Active Edge table)
 X+1/m

Scan line=9
 Y-max=9 (found in AET)
 Delete rows from AET with y-max=9
 Y-min=9 (found in GET)
 Replace y-min=9 row from GET in AET
 X+1/m

Scan line=10
 Y-max=10 (not found in Active Edge table)
 X+1/m
Scan line=11
 Y-max=11 (not found in Active Edge table)
 X+1/m

Scan line=12
 Y-max=12 (found in AET)
 Delete rows from AET with y-max=12
 Y-min=12 (found in GET)
 Replace y-min=12 row from GET in AET
 X+1/m
 GE Table is empty now

Scan line=13
 Y-max=13 (not found in Active Edge table)
 X+1/m
Scan line=14
 Y-max=14 (not found in Active Edge table)
 X+1/m

Scan line=15
 Y-max=15 (found in AET)
 Delete rows from AET with y-max=15
 Y-min=15 (GET is empty)
 Now AE Table is also empty
 Stop

You might also like