Professional Documents
Culture Documents
Materi 05. Clipping: Cyrus-Beck Algorithm: Komputer Grafik 2020/2021 - 1
Materi 05. Clipping: Cyrus-Beck Algorithm: Komputer Grafik 2020/2021 - 1
P(t ) = P0 + ( P1 − P0 )t PEJ
P1
P0 N j • [ P(t ) − PEJ ] = 0
D
θ
Nj
N j • [ P0 − PEJ ]
t=
Edge Ej
−Nj •D
Denominator < 0 → point entering clip region, classify as PE
Denominator > 0 → point leaving clip region, classify as PL
Cyrus & Beck Algorithm
10
t
PE
PL PL
PE
nL = i = [+1 0]
nR= -i= [-1 0]
nT = - ĵ = [0 -1]
nB= +ĵ=[0 +1]
Example
14
w1 = [-1 1] – [0 0] = [-1 1]
D = [ 9 3] – [-1 1] = [10 2]
w1 ⋅ nL = [1 1]⋅[+1 0] = -1
D ⋅ nL = [10 2]⋅[+1 0] = 10
t = (w1 ⋅ nL / D⋅ nL) =
-(-1/10) = 1/10
Example
15
Cases
16
Cases 1: Totally Visible Lines
17
Cases 1
18
(1)
(2)
(1) (2)
(3)
Output First
Output Second Output
Vertex Intersection Output