ABSTRACT
This paper describes a new alorithm for clipping a line in two dimensions against a rectangular window. This algorithm avoids computation of intersection points which are not endpoints of the output line segment. The performance of this algorithm is shown to be consistently better than existing algorithms, including the Cohen-Sutherland and Liang-Barsky algorithms. This performance comparison is machine-independent, based on an analysis of the number of arithmetic operations and comparisons required by the different algorithms. We first present the algorithm using procedures which perform geometric transformations to exploit symmetry properties and then show how program transformation techniques may be used to eliminate the extra statements involved in performing geometric transformations.
- 1.Newman, W. M. and R. F. Sproull. Principles of Interactive Computer Graphics, 2nd ed., McGraw-Hill, New York, 1979. Google ScholarDigital Library
- 2.Sproull, R. F. and I. E. Sutherland. A Clipping Divider, FICC 1968, Thompson Books, Washington, D.C., pp. 765-775.Google ScholarDigital Library
- 3.Cyrus, M. and I. Beck. Generalised Two- and Three- Dimensional Clipping, Computers and Graphics, Vol. 3, No. 1, 1978, pp. 23-28.Google Scholar
- 4.Liang, Y.-D. and B. A. Barsky. A New Concept and Method for Line Clipping, ACM Transactions on Graphies, Vol. 3, No. 1, 1984, pp. 1-22. Google ScholarDigital Library
- 5.Sobkow, M. S., Pospisil, P. and Y.-II. Yang. A Fast Two- Dimensional Line Clipping Algorithm, University of Saskatchewan Technical Report, 86-2.Google Scholar
- 6.Hoare, C. A. R. et al. Laws of Programming: a tutorial paper, Oxford University Programming Research Group PRG-45, 1985.Google Scholar
- 7.Arsac, J. I. Syntactic Source to Source Transforms and Program Manipulation, Communications of the ACM, Vol. 22, No. 1, 1979, pp. 43-54. Google ScholarDigital Library
Index Terms
- An efficient new algorithm for 2-D line clipping: Its development and analysis
Recommendations
An efficient new algorithm for 2-D line clipping: Its development and analysis
This paper describes a new alorithm for clipping a line in two dimensions against a rectangular window. This algorithm avoids computation of intersection points which are not endpoints of the output line segment. The performance of this algorithm is ...
Efficient clipping of arbitrary polygons
Clipping 2D polygons is one of the basic routines in computer graphics. In rendering complex 3D images it has to be done several thousand times. Efficient algorithms are therefore very important. We present such an efficient algorithm for clipping ...
Line clipping algorithm of affine transformation for polygon
ICIC'13: Proceedings of the 9th international conference on Intelligent Computing TheoriesApplying affine transformations to polygon (concave or convex) and line segment, the algorithm of this paper obtains the points of intersection of the polygon and the line segment. Having tested the line segment with a bounding box which includes the ...
Comments