Q2Computer Graphics and Multimedia
Question
Describe the Sutherland-Hodgman Polygon Clipping Algorithm.
Answer
Sutherland-Hodgman algorithm clips a polygon against each edge of a rectangular clipping window sequentially, producing a clipped polygon.
The Sutherland-Hodgman algorithm is a polygon clipping algorithm that clips a polygon against a convex clipping region (such as a rectangle) one boundary edge at a time. The output of clipping against one edge is used as input for the next edge.
- Case 1: S inside, P inside → Output P.
- Case 2: S inside, P outside → Output intersection point I.
- Case 3: S outside, P outside → Output nothing.
- Case 4: S outside, P inside → Output intersection point I, then output P.
The algorithm is applied four times for a rectangular window (left boundary, right boundary, bottom boundary, top boundary). It handles convex polygons exactly and concave polygons approximately (may produce extra edges). It can be extended to 3D (clip against view frustum planes) and is the basis for polygon clipping in the 3D pipeline.