Sutherland cohen line clipping algorithm, Computer Graphics

Describe briefly Sutherland Cohen line clipping algorithm.   OR   Describe Cohen Sutherland line clipping algorithm.

Cohen Sutherland line clipping algorithm In this algorithm we divide the line clipping process into two phases: (1) identify those lines which intersect the clipping window and so need to be clipped and (2) perform the clipping. 

1. Visible: Both endpoints of the line lie within the window. 

2. Not visible: The line definitely lies outside the window. 

3. Clipping candidate: The line is in neither category 1 nor 2. In fig. 1 line AB is in category; line CD and EF are in category 2; and lines GH, IJ, and KJ are in category 3 (clipping candidate).  The algorithm employs an efficient procedure for finding the category of line. It proceeds in two steps:  1. Assign a 4-bit region code to each endpoint of the line. The code is determined according to which of the following nine regions of the plane the endpoint lies in starting from the leftmost bit, each bit of the code is set to true (1) of false (0) according to the scheme We rse the convention that sign (a) = 1 if a is positive, 0 otherwise. Of course, a point with code 0000 is inside the window.  2. The line is visible if both region codes are 0000, and not visible if the bitwise logical AND of the codes is not 0000, and a candidate for clipping if the bitwise logical AND of the region codes is 0000. For a line in category 3 we proceed to find the intersection point of the line with one of the boundaries of the clipping window, or to be exact, with the infinite extension of one of the boundaries. We choose an endpoint of the line say (x1,y1,) that is outside the window, i.e., whose region code is not 0000. We then select an extended line by observing that boundary lines that are candidates for intersection are the ones for which the chosen endpoint must be "pushed across" so as to change a "1" in its code to a "0". Consider line CD in fig. If endpoint C chosen, then the bottom boundary line y = y is selected for computing intersection. On the other hand if endpoint D is chosen, then either the top boundary line y = y of the right boundary line x = x is used. Now we replace endpoint with the intersection point effectively eliminating the portion of the original line that is on the outside of the selected window boundary. The new endpoint is then assigned an update region code and the clipped line re categorized and handled in the same way . This iterative process terminates when we finally reach a clipped line that belongs to either category 1 (visible ) of category 2 ( not visible ). 

Posted Date: 7/1/2012 6:39:09 AM | Location : United States







Related Discussions:- Sutherland cohen line clipping algorithm, Assignment Help, Ask Question on Sutherland cohen line clipping algorithm, Get Answer, Expert's Help, Sutherland cohen line clipping algorithm Discussions

Write discussion on Sutherland cohen line clipping algorithm
Your posts are moderated
Related Questions
Parameterized Systems - Computer Animation Parameterized Systems is the systems which permit objects motion features to be given as part of the object descriptions. The adjus

Combination of Positive and Negative Accelerations Actually, it is not that a body once decelerated or accelerated will remain so, although the motion may include both speed-up

Suggest a method to draw an object as in figure using four Bézier curves of suitable degree Answer: Employ four quartic Bézier curves with the endpoint of one as the initial poi

Normal 0 false false false EN-US X-NONE X-NONE

What is riged body transformation matrix? Show that the composition lf two rotation is additive by concatenating the matrix representation of r (theta 2 ) = R (theta1 + theta 2 ) t

An animation demonstrates a car driving along a road that is given by a Bezier curve along with the subsequent control points:  X k 0 5

Question 1 Write a note on: Audio Spectrum & Audio Waveform Question 2 What is high dynamic range color? Explain gradient color Question 3 Describe Time-Remapping

Disadvantage of the Raster Scan Display Device The major disadvantage of the raster scan is the jagged nature of the lines, happening from the information that the pixels are

1. What is the purpose behind the Staircase effect? Ans. The approximation concerned in the calculation for finding of pixel position concerned in the display of lines and th

What are the important properties of Bezier Curve?  It requires only four control points It always passes by the first and last control points The curve lies enti