计算机与现代化 ›› 2011, Vol. 1 ›› Issue (1): 117-4.doi: 10.3969/j.issn.1006-2475.2011.01.034

• 图像处理 • 上一篇    下一篇

基于顶点的多边形扫描转换

唐永勇1,冯 剑1,杜振华1,胡志勇2   

  1. 1.解放军后勤工程学院,重庆 401311; 2.解放军73808部队,浙江 宁波 315803
  • 收稿日期:2010-09-19 修回日期:1900-01-01 出版日期:2011-01-20 发布日期:2011-01-20

Algorithm of Polygon Scan Conversion Based on Vertex of Polygon

TANG Yong-yong1, FENG Jian1, DU Zhen-hua1, HU Zhi-yong2   

  1. 1.Logistical Engineering University, Chongqing 401311, China; 2.73808 Units of PLA, Ningbo 315803, China
  • Received:2010-09-19 Revised:1900-01-01 Online:2011-01-20 Published:2011-01-20

摘要: 基于新边表出现在有顶点的扫描线上这一特性,提出由顶点y坐标划分扫描线范围和确定活性边表更新的多边形扫描转换算法,该算法避免了对每条扫描线都进行判别。提出确定前后顶点序号的通用算法和通过顶点坐标建立新边表并将新边表与顶点y坐标进行关联的算法。列表比较两种算法的运算步骤,实例运行结果说明新算法具有结构简洁、阅读方便、运行稳定和执行速度快等优点。

关键词: 多边形扫描转换, 新边表, 求模, 标准模板库

Abstract:

Based on the characteristic of new edge tables existing only in the scan line through the vertex, a new polygon scanning conversion algorithm is proposed in which scan range is divided and active edge table is updated by the y coordinate of vertex of polygon. The algorithm avoids the redundant identification operation to each scan line in the sorted edge table method. It is proposed the general algorithm of determined the serial number for front and back the apex and the general algorithm of creating a new edge table and the new edge table associated with of the y coordinates of apex. The steps of the algorithm are compared in a table. The result shows that the new algorithm has many advantages such as simple structure, easy to read, stable operation and fast implementation, etc.

Key words: polygon scan conversion, new edge table, modulus, standard template library