2 A Line Clipping
2 A Line Clipping
2 A Line Clipping
Video: https://www.youtube.com/watch?v=NtwZXGprxag
LINE CLIPPING – COHEN-SUTHERLAND
Cohen and
Sutherland (1968)
developed a method 1001 1000 1010
Where Dx = x2 – x1 and Dy = y2 – y1
The parametric equation of the line segment:
Defines a starting and ending point
Defines a direction
Can be easily extended to 3D
Is better than the standard line equation for many
computer graphics applications
LINE CLIPPING – LIANG-BARSKY (1984)
The point clipping conditions in the parametric form
are:
xwmin <= x1 + tDx <= xwmax
ywmin <= y1 + tDy <= ywmax
(0<=t<=1)
Both changes
EXAMPLE