Powerful Google developer tools for immediate impact! (2023-24 C)
Windowing and clipping final1
1. WINDOWING AND CLIPPING
Polygon clipping:-
For Polytechnic Diploma in Computer Enggineering
/Computer Technology/PGDCA/BCA Students.
Created By:
Krishna Jadhav RLPC
Buldana(kparth.jadhav@gmail.com)
2. Sutherland-Hodgeman Polygon Clipping:
•We can clip polygon by considering whole polygon against each
boundary 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 which
will 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(kparth.jadhav@gmail.com)
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 Clip
Polygon Window
Top
Clip
Krishna Jadhav RLPC
Buldana(kparth.jadhav@gmail.com)
4. Sutherland-Hodgeman Polygon Clipping:
•When we are clipping a polygon with respect to any particular
edge of the window at that time we have to consider following
diff. cases.
•Case1: If the vertex is outside the window boundary and the
second vertex is inside the window, then the intersection point of
polygon with boundary edge of window and the vertex which is
inside the window is stored in q output list. For Edge AB instead of
storing vertex A and B we are storing P1 & B in o/p vertex list.
P1
A B Store P1 and B in Output Vertex list.
C
D
Polygon Window Krishna Jadhav RLPC
Buldana(kparth.jadhav@gmail.com)
5. Sutherland-Hodgeman Polygon Clipping:
•Case2: If Both, First and second vertex of a polygon are lying
inside the window, then we have to store the second vertex only
output vertex list.
Store only C in Output Vertex list.
Krishna Jadhav RLPC
Buldana(kparth.jadhav@gmail.com)
6. Sutherland-Hodgeman Polygon Clipping:
•Case3: If the first vertex is inside the window and second vertex is
outside the window(opposite to Case 1), then we have to store only
intersection point of that edge of polygon with window in output
vertex list.
Store only P2 in Output Vertex list.
P2
Krishna Jadhav RLPC
Buldana(kparth.jadhav@gmail.com)
7. Sutherland-Hodgeman Polygon Clipping:
•Case4: If both first and second vertex of polygon are lying outside
the window then no vertex is stored in output window.
Nothing stored in output vertex list.
Krishna Jadhav RLPC
Buldana(kparth.jadhav@gmail.com)
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 Polygon
Polygon
Krishna Jadhav RLPC
Buldana(kparth.jadhav@gmail.com)
9. CHAPTER 5
CURVES AND FRACTALS:-
Curve generation method:-
Under Construction…….
Krishna Jadhav RLPC
Buldana(kparth.jadhav@gmail.com)