Clipping
Clipping
Clipping means
Identifying portions of a scene that are inside (or outside) a
specified region
Examples
Multiple viewports on a device
Clipping means
Identifying portions of a scene that are inside (or outside) a
specified region
Examples
Multiple viewports on a device
Clip window
interior clipping
what is to be saved is inside the clip window
exterior clipping
what is to be saved is outside clip window
Interior clipping
- keep point P2
P2
(x2, y2)
All-or-none clipping
If any part of object outside clip window
whole object is rejected
Point clipping
Only keep points inside clip window
Line clipping
Only keep segment of line inside clip window
Polygon clipping
Only keep sub-polygons inside clip window
Before P2
P3 P1
P4
After
P3 P1
Before P2
After P1
P2’
P1’
Before
After
P1
(10, 40)
(60, 40)
1000 TOP
OR 0010 RIGHT
------------------
= 1010
Line4
Line2
Line3
204481 Foundation of Computer Graphics November 11, 2024 17
Clipping from region codes
Three cases:
Segment is entirely inside the window - Accept
Segment is entirely outside the window - Reject
Segment intersects the boundary - Clip
ymax
ymin
xmin xmax
P1
Clip from point to TOP of clip window
P1
204481 Foundation of Computer Graphics November 11, 2024 26
Clipping a line
Assume interior
clipping
ABC
Clip window
Clip window
204481 Foundation of Computer Graphics November 11, 2024 30
Student Exercise
ABC
ABC BC
ABC ABC
Clipping means
Identifying portions of a scene that are inside (or
outside) a specified region
Clipping is defined using a clip window
Interior clipping keep things inside clip window /
Exterior cl. outside