Professional Documents
Culture Documents
Clipping P
Clipping P
P
Q
I
Q Q
No Points
Save Q Save I Saved Save I, Q
(a) (b) (c) (d)
Sutherland-Hodgeman
Clipping Example
V1 V2 New Vertex List
Clip Left V2
V3
L2 If P is out
in and
andQQisisout,
in, add the V4
V6 L1 If intersection
P and Q are point
in, add Q.
with
boundary and
only.Q. V5
V5 L1
L2
V3
V1
V4
Sutherland-Hodgeman
Clipping Example
V1 V2 New Vertex List
Clip Top T2 T1 T1
V3
L2
If PP
If
If P and
is in
andout
QQ and
and Qisisadd
areQboth
are in, in,Q.
out,
out,add
add V4
L1 intersection
the nothing. point
intersection withwith
point V5
boundary only.
and Q. L1
V5
L2
V3
T2
V4
Sutherland-Hodgeman
Clipping Example
New Vertex List
Clip Top T2 T1 T1
V3
L2
V4
L1 V5
V5 L1
L2
V3
T2
V4 Clip Right
Sutherland-Hodgeman
Clipping Example
New Vertex List
T2 T1 R1
R2
L2 R1
V4
L1 V5
V5 L1
L2
V3
T2
R2
T1
V4 Clip Right
Sutherland-Hodgeman
Clipping Example
New Vertex List
T2 T1 R2
B1
L2 R1
B2
L1 V5
V5 L1
L2
T2
R2
Clip Bottom B2 B1 T1
R1
V4
Sutherland-Hodgeman
Clipping Example
New Vertex List
T2 T1 R2
B1
L2 R1
B2
L1 V5
V5 L1
L2
T2
R2
B2 B1 T1
R1
Sutherland-Hodgeman Exercise 1
Vertex List
A initial after after after after
left top right bottom
A
B
C
D D
C
Sutherland-Hodgeman Polygon
Clipping Algorithm
Convex polygons are correctly clipped by sutherland
hodgeman algorithm
Concave polygons may be displayed with extraneous lines.
Occurs when clipped polygon have two separate
sections.
Only one output vertex list, the last vertex in the list is
always joined to the first vertex
Weiler-Atherton Clipping
Before Clipping
After Clipping
Text Clipping