Unit-4�Clipping
PREPARED BY: SUSHANT BHATTARAI
Clipping
SUSHANT BHATTARAI
Prepared By:Sushant Bhattarai (Department of CSIT,MMAMC)
3
Applications of Clipping
Prepared By:Sushant Bhattarai (Department of CSIT,MMAMC)
4
Point Clipping
xwmin ≤ x ≤ xwmax
ywmin ≤ y ≤ ywmax
Prepared By:Sushant Bhattarai (Department of CSIT,MMAMC)
5
Line Clipping
Prepared By:Sushant Bhattarai (Department of CSIT,MMAMC)
6
Line Clipping
Prepared By:Sushant Bhattarai (Department of CSIT,MMAMC)
7
Cohen Sutherland Line Clipping Algorithm
Prepared By:Sushant Bhattarai (Department of CSIT,MMAMC)
8
Cohen Sutherland Line Clipping Algorithm
Prepared By:Sushant Bhattarai (Department of CSIT,MMAMC)
9
Step 3.1 : If the result is not 0000, then given line is completely outside.
Step 3.2 : Else line is partially inside.
Step 3.2.a : Choose an endpoint of the line that is outside the given rectangle.
Step 3.2.b : Find the intersection point of the rectangular boundary (based on region code).
Step 3.2.c : Replace endpoint with the intersection point and update the region code.
Step 3.2.d : Repeat step 2 until we find a clipped line either trivially accepted or rejected.
Prepared By:Sushant Bhattarai (Department of CSIT,MMAMC)
10
Liang-Barsky Line Clipping
Prepared By:Sushant Bhattarai (Department of CSIT,MMAMC)
11
Sutherland-Hodgeman Polygon Clipping Algorithm
Prepared By:Sushant Bhattarai (Department of CSIT,MMAMC)
12
Sutherland-Hodgeman Polygon Clipping Algorithm
Prepared By:Sushant Bhattarai (Department of CSIT,MMAMC)
13