














































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















































































Restricting the effect of
graphics primitives to a
sub-region of the canvas
Protecting other portions
of the canvas
x (^) min <= x <= x (^) max
y (^) min <= y <= y (^) max
Intersect that line with each of the four clip rectangle edges. if so, the line cuts the clip rectangle and is partially inside.
More efficient;
Performs initial tests on a
line to determine whether
intersection calculations
can be avoided.
Faster line clippers based on analysis of the parametric equation of a line segment:
More efficient; intersection calculations are reduced.
Polygon clipping - open polygons.
Example
Weiler-Atherton clipping algorithm
Weiler-Atherton clipping algorithm clips any polygon against any clip polygon. The polygons may even have holes.
Four Cases of Polygon Clipping Against One Edge
Case 2 : Exit visible region -
save the intersection point
Case 1 : Wholly inside
visible region save endpoint