Ass 4 MOD
Ass 4 MOD
Question Marking
Model Answer scheme
No.
1
Define Text Clipping and List Various Text Clipping Methods
Defination
Various techniques are used to provide text clipping in a computer graphics. It01 Marks on the meth
depends
Various
Methods 1
Marks Listing
All or none string clipping
All or none character clipping
Text clipping
X,Y is within the given window or not; and decides whether we will use
the minimum and maximum coordinates of the window.
The X-coordinate of the given point is inside the window, if X lies in between Wx1 X Wx2. Same
Line Clipping
333 Use the Cohen Sutherland algorithm to clip two lines P1(35,10)- 4M
P2(65,40) and P3(65,20)-P4(95,10) against a window A(50,10),
B(80,10), C(80,40) and D(50,40).
First Line
2M,Second
Line 2M
4 Describe Sutherland-Hodgeman algorithm for polygon clipping Correct
algorithm 4
In Sutherland-Hodgeman, a polygon is clipped by processing the polygon Marks
boundary as a whole against each window edge. Clipping window must
be convex. This could be accomplished by processing all polygon
vertices against each clip rectangle boundary in turn beginning with the
original set of polygon vertices, first clip the polygon against the left
rectangle boundary to produce a new sequence of vertices. The new set
of vertices could then be successively passed to a right boundary clipper,
a top boundary clipper and a bottom boundary clipper. At each step a
new set of polygon vertices us generated and passed to the next window
boundary clipper. This is the logic used in Sutherland-Hodgeman
algorithm.
Fig. Clipping polygon against successive window boundaries The output
of algorithm is a list of polygon vertices all of which are on the visible
side of clipping plane. Such each edge of the polygon is individually
compared with the clipping plane. This is achieved by processing two
vertices of each edge of the polygon
Step 2: Scan corners for the window as (Wx1, Wy1) and (Wx2, Wy2)
Step 3: Assign the region codes for endpoints P1 and P2 by
Step 4: Check for visibility of line P1, P2 If region codes for both end
points are zero then the line is visible, draw it and jump to step 9.
5
If region codes for end points are not zero and the logical and operation
of them is also not zero then the line is invisible, reject it and jump to
step 9.
If region codes for end points does not satisfies the condition in 4(i) and
4(ii) then line is partly visible.
Step 7: Reject the line segment if any of the end point of it appear outside
the window. Step 8: Draw the remaining line. Step 9: Exit