Page 147 - DCAP504_Computer Graphics
P. 147

Computer Graphics






                                                                Figure 9.8: Line Clipping

























                                       Consider the above two lines AD and EI. Clip the above two lines such that the line
                                       segment DC and HG are visible. You need to show the clipping process using (a)
                                       Cohen Sutherland algorithm and (b) Midpoint Subdivision algorithm.

                          9.4    Summary
                          •   Clipping is used to display the images within the window frame.

                          •   Clipping algorithm is the procedure used to determine  whether the portion of the object lies
                              within or outside the window frame.
                          •   Point clipping and line clipping are the two most common types of clipping.
                          •   Point clipping removes the points that lie outside the window.

                          •   Line clipping determines whether the line lies within or outside the clipping window and removes
                              the line segments that lie outside the window.
                          •   Line clipping includes three algorithms used to determine the line visibility, namely Cohen
                              Sutherland Algorithm, Midpoint Subdivision Algorithm and Liang-Barsky Algorithm.

                          •   Cohen Sutherland Algorithm determines whether the  line is visible, invisible or clipping
                              candidate.
                          •   If the line is clipping candidates then Cohen Sutherland  algorithm performs calculation of the
                              intersection of the line with the window edge.
                          •   Midpoint Subdivision Algorithm avoids the calculation involved Cohen Sutherland algorithm by
                              simply subdividing the line at its  midpoint until  the line segment is  completely visible or
                              completely invisible.
                          •   Liang-Barsky Algorithm based on analysis of the parametric line equations.









                          140                     LOVELY PROFESSIONAL UNIVERSITY
   142   143   144   145   146   147   148   149   150   151   152