Professional Documents
Culture Documents
CG Exp 2
CG Exp 2
CG Exp 2
Roll No : C23350
Div : 3(C)
Batch : S11
Subject : CGL
Experiment No. 2
Questions:
4. Explain even odd and winding number method for visibility of line?
Ans: 1) Even- Odd Method: This method determine whether the point is inside the polygon or
not. One simple method of doing this is to construct a line segment between the point in
question and a point known to be outside the polygon. Now count how many intersections of
the line segment with the polygon boundary occur. If there are an odd number of intersections,
then the point in question is inside; otherwise it is outside. This
method is called the even-odd method of determining polygon inside points.
2) Winding Number Method: Another approach to do the inside test is the winding-number
method. Let us consider a point in question and a point on the polygon boundary. Conceptually,
we can stretch a piece of elastic between these points and slide the end point on the polygon
boundary for one complete rotation. We can then examine the point in question to see how
many times the elastic has wound around it. If it is wound at least once, then the point is inside.
If there is no net winding, then the point is outside.
5. Explain Sutherland Hodgeman Clipping?
Ans: A polygon can be clipped by processing its boundary as a whole against each window
edge. This is achieved by processing all polygon vertices against each clip rectangle boundary in
turn. Beginning with the original set of polygon vertices, we could 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 is
generated and passed to the next window boundary clipper. This is the fundamental idea used
in the Sutherland - Hodgeman algorithm.