Lecture14b Clipping
Lecture14b Clipping
0001
0000
0010
0101
0100
0110
outside
inside v2
outside v2 v1
inside
outside v2
inside
v1
v1
Outside to outside: Output: nothing
v3
v2
v2
v2 v3 v1 v2
Output
v2
v1v2 v2v2 v2
Output
v2v2
Edges
Sutherland-Hodgman
Weiler-Atherton
Clipping in 3D
Suppose the view volume has been normalized. Then the clipping boundaries are just:
xwmin = -1 ywmin = -1 zwmin = -1 xwmax = 1 ywmax = 1 zwmax = 1
Suppose that h > 0, which is true in normal cases, then -h < xh < h and -h < yh < h and -h < zh < h
0001
0000
0010
0101
0100
0110
Example: If h + xh < 0, then bit 1 is set to 1. This is because if -h > xh, then the point is to the left of the viewing volume.
Clipping Polygons
First, perform trivial acceptance and rejection using, for example, its coordinate extents. Polygons usually split into triangle strips. Then each triangle is clipped using 3D extension of the Sutherland-Hodgman method