A Simple and Fast Line-Clipping Method as a Scratch Extension for Computer Graphics Education

Line clipping is a fundamental topic in an introductory computer graphics course. An understanding of a line-clipping algorithm is reinforced by having students write actual code and see the results by choosing a user-friendly integrated development environment such as Scratch, a visual programming language especially useful for children. In this article a new computation method for 2D line clipping against a rectangular window is introduced as a Scratch extension in order to assist computer graphics education. The proposed method has been compared with Cohen-Sutherland, Liang-Barsky, Cyrus-Beck, Nicholl-Lee-Nicholl and Kodituwakku-Wijeweera-Chamikara methods, with respect to the number of operations performed and the computation time. The performance of the proposed method has been found to be better than all of the above-mentioned methods and it is found to be very fast, simple and can be implemented easily in any programming language or integrated development environment. The simplicity and elegance of the proposed method makes it suitable for implementation by the student or pupil in a lab exercise.

[1]  Michael Wimmer,et al.  Distinctive Approaches to Computer Graphics Education , 2018, Comput. Graph. Forum.

[2]  M. Pauline Baker,et al.  Computer Graphics, C Version , 1996 .

[3]  Jay Beck,et al.  Generalized two- and three-dimensional clipping , 1978, Comput. Graph..

[4]  David Stahl A lab exercise for 2D line clipping , 2008 .

[5]  John E. Howland,et al.  Computer graphics , 1990, IEEE Potentials.

[6]  C. Clutterbuck,et al.  Computer Graphics as an Introduction to Computing , 1974 .

[7]  Yee-Hong Yang,et al.  A fast two-dimensional line clipping algorithm via line encoding , 1987, Comput. Graph..

[8]  Qunsheng Peng,et al.  An efficient line clipping algorithm based on adaptive line rejection , 2002, Comput. Graph..

[9]  Thomas Ertl,et al.  Computer Graphics - Principles and Practice, 3rd Edition , 2014 .

[10]  Václav Skala A new approach to line and line segment clipping in homogeneous coordinates , 2005, The Visual Computer.

[11]  Brian A. Barsky,et al.  A New Concept and Method for Line Clipping , 1984, TOGS.

[12]  Shi Kaijian,et al.  An efficient line clipping algorithm , 1990, Comput. Graph..

[13]  Vaclav Skala AN EFFICIENT ALGORITHM FOR LINE CLIPPING , 1993 .

[14]  Sushil Chandra Dimri A Simple and Efficient Algorithm for Line and Polygon Clipping in 2-D Computer Graphics , 2015 .

[15]  Václav Skala,et al.  O(lg N) line clipping algorithm in E2 , 1994, Comput. Graph..

[16]  Václav Skala,et al.  An efficient algorithm for line clipping by convex polygon , 1993, Comput. Graph..

[17]  End Semester Mca Computer Graphics with Open GL , 2009 .

[18]  Bimal Kumar Ray,et al.  A Line Segment Clipping Algorithm in 2D , 2012 .