Cohen sutherland line clippings algorithm, Computer Graphics

Cohen Sutherland Line Clippings Algorithm

The clipping problem is identified by dividing the region surrounding the window area into four segments Up as U, Down as D, Left as L, Right as R and assignment of number 1 and 0 to respective segments assists in positioning the area surrounding the window. How this positioning of areas is performed can be well determined by understood in following figure.

2465_Cohen Sutherland Line Clippings Algorithm.png

Figure: Positioning of regions surrounding the window

In figure as given above we have noticed that each coding of areas U, D, L and R is done along w.i.t. window region. Since window is neither Left nor Right, neither up nor down so, the respective bits UDLR are 0000; currently see area1 of above figure. The positioning code UDLR is 1010, that is the area1 lying on the position that is upper left side of the window. Hence, area1 has UDLR code 1010 i.e. Up so U=1, not Down so D=0, Left so L=1, not Right so R=0.

The sense of the UDLR code to identify the location of region w.i.t. window is:

1st bit ⇒ Up(U) ; 2nd bit ⇒ Down(D) ;3rd bit ⇒ Left(L) ;  4th bit ⇒ Right(R),

Currently, to perform Line clipping for different line segment that may reside within the window region partially or fully, or may not even lie in the widow area; we utilize the tool of logical ANDing among the UDLR codes of the points lying on the line.

Logical ANDing (^) operation

=>

1 ^ 1 = 1; 1 ^ 0 = 0;

between respective bits implies

 

Note:

 

0 ^ 1 = 0; 0 ^ 0 = 0

 

  • UDLR code of window is 0000 all the time and with respect to this will generate bit codes of other areas.
  • A line segment is observable if both the UDLR codes of the end points of the line segment equal to 0000 that is UDLR code of window area. If the resulting code is not 0000 then, which line segment or section of line segment may or may not be observable
Posted Date: 4/3/2013 2:54:25 AM | Location : United States







Related Discussions:- Cohen sutherland line clippings algorithm, Assignment Help, Ask Question on Cohen sutherland line clippings algorithm, Get Answer, Expert's Help, Cohen sutherland line clippings algorithm Discussions

Write discussion on Cohen sutherland line clippings algorithm
Your posts are moderated
Related Questions
For orthographic parallel projection:    glOrtho(left, right, bottom, top, near, far);  glOrtho2D(left, right, bottom, top);    Here left, right define the x-direction ex

Definitions of Hypertext A manner of presenting information online along with links among one piece of information and the other. These links are termed as hypertext links

WPG: It is word perfect graphic file that is used via Word Perfect. It first came out with the release of word perfect 5.0. Such files can include bitmaps, line arts and vector gr

Architecture: One of the purposes for the development of virtual reality (that is in fact a form of computer animation) was which it was going to be very helpful to architects. He

Key Frame Systems - computer animation This method is for low-level motion control. In fact these systems comprise languages that are designed simply to produce the in-between

Types of Graphic Images: Graphic images have been processed through a computer can generally be divided in two distinct categories. That image is either bitmap files or vecto

What is  Raster Scan Display A raster scan display device using CRT on the other hand directs the electron beam across the screen, one row at a time from top to bottom. In a ra

Traditional Animation Techniques - Computer Animation Before the advent of computer animation, each animation was done via hand that involves an enormous amount of work. You

Alias Wavefront - Softwares for Computer Animation Alias is one of the highest computer animation packages out there. Alias was formed by the company which used to be Alias, a

Three Dimensional Concepts and Display Methods   Imagine yourself taking a picture by a camera.  What do you normally do?  You specify a viewpoint and view direction and then s