Ass 4 Model
Ass 4 Model
Question Marking
Model Answer scheme
No.
1 Define polygon clipping.
Any suitable
A set of connected lines are considered as polygon; polygons are clipped definition: 2
based on the window and the portion which is inside the window is kept M
as it is and the outside portions are clipped. OR Polygon clipping is
removal of part of an object outside a polygon.
Step 1: Scan two end points for the line P1(x1, y1) and P2(x2, y2).
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 initializing
code with 0000.
If region codes for both end points are zero then the line is visible, draw
it and jump to step 6.
If region codes for end points are not zero and the logical Anding
operation of them is also not zero then the line is invisible, reject it and
jump to step 6. If region codes for end points does not satisfies the
condition in 4 (i) and 4 (ii) then line is partly visible.
Step5: Find midpoint of line and divide it into two equal line segments
and repeat steps 3 through 5 for both subdivided line segments until you
get completely visible and completely invisible line segments.
Step 6: Exit
Use Cohen-Sutherland outcode algorithm to clip line PI (40, 15) -- P2 Proper result
(75. 45) against a window A (50, 10), B (80, 10). C(80, 40) & D(50,40) 4M
P1 (40, 15) - P2 (75, 45) Wxi = 50 Wy2 = 40 Wx2 = 80 Wy2 = 10 Point Endcode ANDing P1 0001
Hence: .
Many techniques are used to provide text clipping in a computer graphics. It depends on the metho
3) Text clipping
The following figure shows all or none string clipping
This clipping method is based on characters rather than entire string. In this method if the string is e
This clipping method is based on characters rather than the entire string.
In this method if the string is entirely inside the clipping window, then
we keep it. If it is partially outside the window, then you reject only the
portion of string being outside. If the character is on the boundary of the
clipping window, then we discard only that portion of character that is
outside of the clipping window.