CS324 Computer Graphics
Lecture ? – October 30th, 2017
Liang-Barksy line clipping
In Cohen-Sutherland method you can reject certain parallel cases.
- When the infinite extension of the line proceeds from the outside to the inside of the infinite extension of the clip boundary.
- Intersection with clip boundary occurs at .
- Compute two such values of , and that define the part of the line within the clip box.
Polygon Clipping
If you clip parts of a polygon, you have to add the sides back so that you can fill the polygon correctly.
This can be done with Sutherland-Hodgman:
-
This algorithm operates a pipeline of checks.
-
All polygon edges are first checked against one of the infinite clipping lines of the clip rectangle.
-
The surviving vertices and generated vertices are output to next stage.
-
Next stage checks these vertices against one of the remaining clip boundaries, and so on.