摘要
Cohen-Sutherland裁剪算法因直线与窗口边界求交点次数多而降低算法效率。提出了一种改进Sutherland-Cohen裁剪算法,将完全在窗口内和窗口外的直线判断出来,根据直线端点编码确定辅助线,利用平面上三点的关系判断直线与窗口的哪条边相交。改进的算法使得求交点次数降为最多两次,且避免计算斜率与距离,大大提高算法的效率。算法思想简单,操作方便,有利于硬件实现,对图形学的应用具有重要的实用价值。
Cohen-Sutherland clipping algorithm is lower efficiency because of four intersection operations of line segment and window edge lines. In this paper, a modified Sutherland-Cohen line clipping algorithm is proposed. The line in the window or out the window completely is judged. The auxiliary line is decided according by the coding of a line endpoint, and one of edges of the window is deduced to compute the point of intersection with the line by the relation of three points on a plane. The modified algorithm makes intersection operation be twice at most, avoiding to compute the slope and distance, can improve the efficiency of the algorithm greatly. The thought is simple, the operation is convenient, hardware implementation is easy, and is important practical value for graphics applications.
出处
《计算机工程与应用》
CSCD
2012年第34期175-178,共4页
Computer Engineering and Applications
基金
陕西省自然科学基金(No.2009JM8004-7)
陕西省教育厅专项科研计划项目(No.2010JK904)