0% found this document useful (0 votes)
30 views

Scan Lines Algorithm: SMX B X SBM S X S BMX M

The document describes the scan line algorithm for finding intersection points between scan lines and polygon edges. It involves: 1) Intersecting scan lines with polygon edges. 2) Ignoring horizontal edges and counting vertices on scan lines twice if the slope changes. 3) Finding intersections of scan lines and edges using formulas to calculate the x-coordinate where they intersect.
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Scan Lines Algorithm: SMX B X SBM S X S BMX M

The document describes the scan line algorithm for finding intersection points between scan lines and polygon edges. It involves: 1) Intersecting scan lines with polygon edges. 2) Ignoring horizontal edges and counting vertices on scan lines twice if the slope changes. 3) Finding intersections of scan lines and edges using formulas to calculate the x-coordinate where they intersect.
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

9597-6-18E AID: 1112 | 15/06/2014

Scan lines algorithm


Fig. Intersection points aong t!e scan ines t!at intersect po"gon #ertices.
Algorithm:
First"$ t!e scan ines s!o%& 'e intersecte& (it! a t!e e&ges o) po"gon.
*!ere are so+e pro'e+s or specia cases (!ic! !a#e to 'e controe&.
o Ignore !ori,onta e&ges
o -ertices "ing on scan ines - co%nt t(ice i) t!ere is c!ange in a sope
o - i) t!ere is no c!ange t!en e&ge s!o%& 'e
s!ortene& '" one scan ine.
E&ges t!at intersect (it! " scanine (i s%re" 'e intersecte& '" scan ine ".1.
*!e )or+%a to )in& t!e scanine
s
is
y s =
an& )or an e&ge is
*!e intersection o) a scanine an& an e&ge can 'e )in& o%t '" t!e )or+%a
s
s mx b = +
o /o it 'eco+es 0 1 /
s
x s b m =
*o cac%ate )or scan ine 1 s +
o
1
0 1 1 / 1/
s s
x s b m x m
+
= + = +
Scan Line y
k
+ 1
Scan Line y
k
(X
k + 1
, Y
k + 1
)
(X
k
, Y
k
)

You might also like