Area Clipping or Polygon Clipping Modify line clipping

  • Slides: 13
Download presentation
Area Clipping or Polygon Clipping

Area Clipping or Polygon Clipping

 • Modify line clipping procedures. • After applying line clipper the polygon is

• Modify line clipping procedures. • After applying line clipper the polygon is displayed as a series of unconnected line segments.

 • For polygon clipping generate algorithm for appropriate area fill

• For polygon clipping generate algorithm for appropriate area fill

Sutherland Hodgeman Method • Clip the polygon by processing the polygon boundary as a

Sutherland Hodgeman Method • Clip the polygon by processing the polygon boundary as a whole against each window. • Process all polygon vertices against each clip rectangle boundary in turn. • First clip the polygon against the left boundary to produce a new sequence of vertices. • The new sequence of vertices is then successive passed to right, bottom and top boundary clipper. • At each step a new sequence of output vertices is generated and passed to the next boundary clipper

Sutherland-Hodgman Polygon Clipping • • Input each edge (vertex pair) successively. Output is a

Sutherland-Hodgman Polygon Clipping • • Input each edge (vertex pair) successively. Output is a new list of vertices. Each edge goes through 4 clippers. The rule for each edge for each clipper is: – If first input vertex is outside, and second is inside, output the intersection and the second vertex – If both input vertices are inside, then just output second vertex – If first input vertex is inside, and second is outside, output is the intersection – If both vertices are outside, output is nothing. – The last vertex in the list is always added to the first vertex

Sutherland-Hodgeman Polygon Clipping: Four possible scenarios at each clipper outside inside v 2 v

Sutherland-Hodgeman Polygon Clipping: Four possible scenarios at each clipper outside inside v 2 v 1’ Outside to inside: Output: v 1’ and v 2 outside inside v 2 v 1’ v 1 Inside to inside: Output: v 2 Inside to outside: Output: v 1’ v 1 Outside to outside: Output: nothing

–The last vertex in the list is always added to the first vertex

–The last vertex in the list is always added to the first vertex

Sutherland-Hodgeman Polygon Clipping v 2’ v 3 Figure 6 -27, page 332 v 1’

Sutherland-Hodgeman Polygon Clipping v 2’ v 3 Figure 6 -27, page 332 v 1’ v 3’ Left Clipper v 1 Right Clipper Bottom Clipper v 1 v 2 v 2 v 2’v 3’ v 2 v 3 v 2’v 3’ v 3 v 1 v 3’v 1 v 1 v 2 Edges Output v 2” Top Clipper v 2”v 1’ v 3’v 1 v 1’v 2 v 1’v 2 v 2 v 2’v 2” Output Edges v 2’ v 2” Output Final

Window

Window

 • Not applicable polygons where the clipped regions have separate sections. –The last

• Not applicable polygons where the clipped regions have separate sections. –The last vertex in the list is always added to the first vertex

Text Clipping All or none text clipping All or none character clipping Clipping individual

Text Clipping All or none text clipping All or none character clipping Clipping individual character 2 NG I R ST STRING 1 S 2 G IN TR