摘要
提出一种任意多边形窗口线裁剪新方法,它不解方程而通过矩阵乘法得到窗口和线段的交点。对于一组待裁剪线段,该方法先做简单的包围盒预处理,将那些和包围盒无交的线段排除在求交之外;然后引进齐次坐标,构造一组仿射变换矩阵,通过矩阵乘法对任意多边形窗口和待裁剪线段实施连续仿射变换,完成窗口和直线求交操作并从矩阵中获得交点;经过交点排序、配对等过程,得到多边形裁剪线段的结果。经实验对比,该新方法有效,并且速度得以提高。
This paper proposed a new method for line clipping with a polygon. The method gets the intersection points of a polygon and a line by matrix multiplication. For a set of line segments, the algorithm of this paper tests it by a bounding box that included the polygon to discard the line segments which do not intersect the box, then the algorithm introduces homogeneous coordinates, and makes a group of matrixes and applies the matrixes multiplication to the po- lygonal window and the straight line to make the continuous affine transformations, and gets the intersection points of the window and straight line from the matrix. Having sorted and matched the points of intersection, the algorithm of this paper obtains the result of the polygon clipping the line segment. The experiment shows that the new method is ef-fective,and the speed is improved.
出处
《计算机科学》
CSCD
北大核心
2013年第10期309-316,F0003,共9页
Computer Science
关键词
裁剪
仿射变换
矩阵
多边形
窗口
Clipping, Affine transformation, Matrix, Polygon, Window