
















































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!

















































All primitives are clipped to the boundaries of this clipping rectangle;
Primitives lying outside the clip rectangle are not drawn.
The default clipping rectangle is the full canvas (the screen); We cannot see any graphics primitives outside the screen
Clipping of lines against rectangles
Simpler problem
Xmin < X < Xmax And Ymin < Y < Ymax
Trivial Reject โ
discard a line with both endpoints outside the clipping boundaries
For all other lines โ
compute intersections of line with clipping boundaries
If 0 <= u <= 1 then the line does enter the interior of the window at that boundary
otherwise, the line does not enter the interior of the window at that boundary.
Need to consider only endpoints of a line:
If both endpoints lie inside the clip rectangle; it can be trivially accepted.
If both endpoints are outside the clip rectangle, we need to perform further calculations to determine whether there are any intersections.
Intersect that line with each of the four clip rectangle edges. if so, the line cuts the clip rectangle and is partially inside.