计算机科学 ›› 2013, Vol. 40 ›› Issue (10): 309-317.

• 图形图像与模式识别 • 上一篇    

基于矩阵乘法的多边形窗口线裁剪算法

黄文钧   

  1. 广西民族大学信息科学与工程学院 南宁530006
  • 出版日期:2018-11-16 发布日期:2018-11-16

Matrix Multiplication for Line Clipping of Polygon

HUANG Wen-jun   

  • Online:2018-11-16 Published:2018-11-16

摘要: 提出一种任意多边形窗口线裁剪新方法,它不解方程而通过矩阵乘法得到窗口和线段的交点。对于一组待裁剪线段,该方法先做简单的包围盒预处理,将那些和包围盒无交的线段排除在求交之外;然后引进齐次坐标,构造一组仿射变换矩阵,通过矩阵乘法对任意多边形窗口和待裁剪线段实施连续仿射变换,完成窗口和直线求交操作并从矩阵中获得交点;经过交点排序、配对等过程,得到多边形裁剪线段的结果。经实验对比,该新方法有效,并且速度得以提高。

关键词: 裁剪,仿射变换,矩阵,多边形,窗口

Abstract: 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 polygonal 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 effective,and the speed is improved.

Key words: Clipping,Affine transformation,Matrix,Polygon,Window

[1] Skala V.O(lgN) line clipping algorithm in E2[J].Computers & Graphics,1994,18(4):517-527
[2] Skala V.A new approach to line and line segment clipping in Homogeneous Coordinates[J].Visual computer,2005,21(11):905-914
[3] 唐井林,张庆,孙惠学.基于叉积法的凸多边形窗口裁剪算法[J].东北重型机械学院学报,1995,9(1):23-25
[4] 孙燮华.凸多边形窗口线裁剪的新算法[J].中国图像图形学报,2003,8(12A):1475-1477
[5] 李伟青.凸多边形窗口线裁剪的折半查找算法[J].计算机辅助设计与图形学学报,2005,7(5):962-965
[6] 韩俊卿,葛永慧,张东升.多边形窗口的矢量图形裁剪算法[J].太原理工大学学报,2005,36(2):160-163
[7] 任洪海.基于点区域分布的多边形窗口线裁剪算法[J].科学技术与工程,2009,9(16):4833-4835
[8] 陆国栋,刑世海,彭群生.基于顶点编码的多边形窗口线裁剪高效算法[J].计算机学报,2002,25(9):987-993
[9] 李伟青.基于扫描带的任意多边形窗口线裁剪算法[J].工程图学学报,2005(2):35-40
[10] 孙春娟,王文成,李静,等.基于凸片段分解的多边形窗口线裁剪算法[J].计算机辅助设计与图形学学报,2006,8(12):1799-1805
[11] 李静,王文成,吴恩华.基于凸剖分的多边形窗口线裁剪算法[J].计算机辅助设计与图形学学报,2007,9(4):425-429
[12] Huang Y Q,Liu Y K.An algorithm for the clipping against a polygon based on shearing transformation[J].Computer Graphi-cs Forum,2002,21(4):683-688
[13] Huang Wen-jun.The Line Clipping Algorithm Basing on Affine Transformation[J].Intelligent Information Management,2010,2(6):380-385

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!