Share This Article:

The Line Clipping Algorithm Basing on Affine Transformation

Abstract Full-Text HTML Download Download as PDF (Size:105KB) PP. 380-385
DOI: 10.4236/iim.2010.26046    7,948 Downloads   12,804 Views   Citations
Author(s)    Leave a comment

ABSTRACT

A new algorithm for clipping line segments by a rectangular window on rectangular coordinate system is presented in this paper. The algorithm is very different to the other line clipping algorithms. For the line segments that cannot be identified as completely inside or outside the window by simple testings, this algorithm applies affine transformations (the shearing transformations) to the line segments and the window, and changes the slopes of the line segments and the shape of the window. Thus, it is clear for the line segment to be outside or inside of the window. If the line segments intersect the window, the algorithm immediately (no solving equations) gets the intersection points. Having applied the inverse transformations to the intersection points, the algorithm has the final results. The algorithm is successful to avoid the complex classifications and computations. Besides, the algorithm is effective to simplify the processes of finding the intersection points. Comparing to some classical algorithms, the algorithm of this paper is faster for clipping line segments and more efficient for calculations.

Conflicts of Interest

The authors declare no conflicts of interest.

Cite this paper

W. Huang, "The Line Clipping Algorithm Basing on Affine Transformation," Intelligent Information Management, Vol. 2 No. 6, 2010, pp. 380-385. doi: 10.4236/iim.2010.26046.

References

[1] D. Hearn and M. P. Baker, “Computer Graphics,” C Version, 2nd Edition, Prentice Hall, Inc., Upper Saddle River, 1998, p. 226.
[2] M. Cyrus and J. Beck, “Generalized Two and Three Dimensional Clipping,” Computers and Graphics, Vol. 3, No. 1, 1978, pp. 23-28.
[3] D. Hearn and M. P. Baker, “Computer Graphics,” C Version, 2nd Edition, Prentice Hall, Inc., Upper Saddle River, 1998, p. 233.
[4] T. M. Nicholl, D. T. Lee and R. A. Nicholl, “An Efficient New Algorithm for 2-D Line Clipping: Its Development and Analysis,” Computers and Graphics, Vol. 21, No. 4, 1987, pp. 253-262.
[5] D. Hearn and M. P. Baker, “Computer Graphics,” C Version, 2nd Edition, Prentice Hall, Inc., Upper Saddle River, 1998, p. 230.
[6] C. B. Chen and F. Lu, “Computer Graphics Basis,” Publishing House of Electronics Industry, Beijing, 2006, pp. 167-168.
[7] V. Skala, “O (lg N) Line clipping Algorithm in E2,” Computers and Graphics, Vol. 18, No. 4, 1994, pp. 517- 527.
[8] Y. D. Liang and B. A. Barsky, “The Optimal Tree Algorithm for Line Clipping,” Technical Paper Distributed at Eurographics’92 Conference, Cambridge, 1992, pp. 1-38.
[9] V. Skala, “A New Approach to Line and Line Segment Clipping in Homogeneous Coordinates,” Visual Computer, Vol. 21, No. 11, 2005, pp. 905-914.
[10] Y. D. Liang, B. A. Barsky and M. Slater, “Some Improvements to a Parametric Line Clipping Algorithm,” Technical Report No. UCB/CSD 92/688, Computer Science Division, University of California, Berkeley, 1992, pp. 1-22.

  
comments powered by Disqus

Copyright © 2019 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.