Docsity

Clipping-Computer Graphics-Lecture Slides, Slides of Computer Graphics

Partial preview of the text

Download Clipping-Computer Graphics-Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!

Computer Graphics

Clipping Contd…

Polygon Clipping ^ To clip polygons the line-clipping techniquesneed to be modified ^ A polygon processed using a line clipper maybe displayed as a series of unconnected linesegments

Polygon Clipping ^ Find the Part of a Polygon Inside the ClipWindow?

Before Clipping

Polygon Clipping ^ Find the Part of a Polygon Inside the ClipWindow?

After Clipping

Sutherland-Hodgeman Polygon Clipping ^ A polygon boundary is processed as a wholeagainst the window edge ^ Polygon vertices are processed against each clipwindow boundary in turn^ ^ The polygon is clipped against the left boundary first^ ^ Then the right boundary^ ^ Then the bottom boundary^ ^ And finally top boundary ^ The new set of vertices after each step are passedto the next window boundary

Sutherland-Hodgeman PolygonClipping ^ Clip to Each Window Boundary One at aTime

Sutherland-Hodgeman PolygonClipping ^ Clip to Each Window Boundary One at aTime

Sutherland-Hodgeman PolygonClipping ^ Clip to Each Window Boundary One at aTime

Sutherland-Hodgeman Polygon Clipping

Sutherland-Hodgeman Polygon Clipping

Sutherland-Hodgeman Polygon Clipping ^ Since there is only one output vertex list, the last vertex is alwaysjoined to the first vertex ^ Solution 1: A concave polygon may be divided in to various convexpolygons and then processed ^ Solution 2: Check the final vertex list for multiple points along aboundary and correctly join pairs of vertices ^ Solution 3: Choose a more general polygon clipper algorithm suchas the Weiler-Atherton algorithm

Weiler-Atherton Polygon Clipping ^ This technique processes Concave polygonscorrectly ^ The polygon is processed along the polygonedges following a clockwise or anti-clockwisedirection

Clipping to a Boundary ^ Do Inside Test for Each Point in Sequence,Insert New Points When Cross Window Boundary,Remove Points Outside Window Boundary

P^1 P^2 P 3

P^4

P^5

InsideOutside

WindowBoundary

Clipping to a Boundary ^ Do Inside Test for Each Point in Sequence,Insert New Points When Cross Window Boundary,Remove Points Outside Window Boundary

P^1 P^2 P 3

P^4

P^5

InsideOutside

WindowBoundary