15. 168 471 Computer Graphics, KKU. Lecture 8 15
Parametric Line-Clipping Algorithm
0 1 0
0 1 0
0
1 0
[ ( ) ] 0
[ ( ) ] 0
[ ] [ ] 0
[ ]
( )
i Ei
i Ei
i Ei i
i Ei
i
N P t P
N P P P t P
N P P N P P t
N P P
t
N D
where D P P
• Introduced by Cyrud and Beck in 1978
• Efficiently improved by Liang and Barsky
• Essentially find the parameter t from P(t) = P0 + (P1-P0)t
16. 168 471 Computer Graphics, KKU. Lecture 8 16
Parametric Line-Clipping Algorithm
(cont.)
• Formally, intersections can be classified as PE (potentially entering)
and PL (potentially leaving) on the basis of the angle between P0P1
and Ni
•Determine tE or tL for each intersection
• Select the line segment that has maximum tE and minimum tL
•If tE > tL, then trivially rejected
0 ( 90)
0 ( 90)
i
i
N D PE angle
N D PL angle
19. 168 471 Computer Graphics, KKU. Lecture 8 19
Clipping Circles and Ellipses
• Firstly, do a trivial accept/reject test by intersecting
the circle’s/elleipse’s extent with the clip rectengle.
• If intersection occurs, divide it into and do the trivial
accept/reject test for each.
• If scan conversion is fast or if the circle is not too
large, scissoring on a pixel-by-pixel basis would be
more efficient.