Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Windowing and clipping final1


Published on

this is only for

Windowing and clipping final1

  1. 1. WINDOWING AND CLIPPINGPolygon clipping:-For Polytechnic Diploma in Computer Enggineering/Computer Technology/PGDCA/BCA Students. Created By: Krishna Jadhav RLPC Buldana(
  2. 2. Sutherland-Hodgeman Polygon Clipping:•We can clip polygon by considering whole polygon against eachboundary edge of the window.•We know that represent a polygon we need set of vertices.•We will pass this set of vertices or a polygon to a procedure whichwill clip the polygon against left edge.1. This left procedure generates new set of vertices which indicates left clipped polygon.2. Again we will get new set of vertices is passed to the right boundary clipper procedure.3. Then we will pass this new set of vertices to bottom boundary clipper and lastly to top boundary clipper procedure. Krishna Jadhav RLPC Buldana(
  3. 3. Sutherland-Hodgeman Polygon Clipping: •At the end of every clipping stage a new set of vertices is generated and this new set of vertices(Modified polygon) is passed to the next clipping stage. Following fig. shows four diff. stages which are require to clip a polygon. Left Right Bottom Clip Clip ClipPolygon Window Top Clip Krishna Jadhav RLPC Buldana(
  4. 4. Sutherland-Hodgeman Polygon Clipping:•When we are clipping a polygon with respect to any particularedge of the window at that time we have to consider followingdiff. cases.•Case1: If the vertex is outside the window boundary and thesecond vertex is inside the window, then the intersection point ofpolygon with boundary edge of window and the vertex which isinside the window is stored in q output list. For Edge AB instead ofstoring vertex A and B we are storing P1 & B in o/p vertex list. P1A B Store P1 and B in Output Vertex list. C D Polygon Window Krishna Jadhav RLPC Buldana(
  5. 5. Sutherland-Hodgeman Polygon Clipping:•Case2: If Both, First and second vertex of a polygon are lyinginside the window, then we have to store the second vertex onlyoutput vertex list. Store only C in Output Vertex list. Krishna Jadhav RLPC Buldana(
  6. 6. Sutherland-Hodgeman Polygon Clipping:•Case3: If the first vertex is inside the window and second vertex isoutside the window(opposite to Case 1), then we have to store onlyintersection point of that edge of polygon with window in outputvertex list. Store only P2 in Output Vertex list. P2 Krishna Jadhav RLPC Buldana(
  7. 7. Sutherland-Hodgeman Polygon Clipping:•Case4: If both first and second vertex of polygon are lying outsidethe window then no vertex is stored in output window. Nothing stored in output vertex list. Krishna Jadhav RLPC Buldana(
  8. 8. Sutherland-Hodgeman Polygon Clipping: Once all vertices have been considered for one clip window boundary, the output list of vertices is clipped against the next window boundary. So the Block diagram for this algorithm.Input Bottom Top Clipped Left Right Clip Clip Clip Clip PolygonPolygon Krishna Jadhav RLPC Buldana(
  9. 9. CHAPTER 5 CURVES AND FRACTALS:-Curve generation method:- Under Construction……. Krishna Jadhav RLPC Buldana(