搜索资源列表
Bresenham高效画线算法
- 画线的算法不少,但要作到高速、简单并不容易。斜率相乘法是最简单的方法之一,但计算每个点均要花费不少时间用于乘、除法运算;下面介绍的是Bresenham s高效画线算法,对每个点的坐标计算只要加、减法就能完成。-line drawing algorithm, but a lot to be done fast, simple is not easy. The slope is the most simple multiplication is one of the ways, but each p
324234
- 假定直线斜率k在0~1之间(k的其它取值可以类似处理),当前象素点为(xp,yp),则下一个象素点有两种可选择点P1-assumed linear slope of the k-1 between 0 (k values can be other similar processing), the current pixel (xp, yp), the next one pixel can have two points P1
openglline
- 程序使用了Bresenham算法的思想,将四个象限的问题通过交换端点的方法合并成一,四象限的问题。再利用sign变量,统一成一个问题。又考虑到斜率<1,>1最终问题分成了两种情况。在直线插补程序的一开始,把斜率为正无穷的情况单独进行讨论。最终完成了整个程序-procedures for the use of the Bresenham algorithm thinking, four quadrant of the issue through the exchange of endp
Bresenham
- 该程序实现了Bresenham算法画直线,将四个象限的问题通过交换端点的方法合并成一,四象限的问题。再利用sign变量,统一成一个问题。又考虑到斜率<=1,>1,不存在,最终问题分成了三种情况。-The program implements Bresenham algorithm for drawing a straight line, the four quadrants of the problem through the exchange of endpoint methods
Clock-Wipe
- 1. 首先把兩張圖讀進來,求出高與寬和設定time的最大值 2. 利用atan()這個數學函式算出角度,以圖的中心為基準width/2和height/2 把x,y帶入atan(-(y-height/2)/(x-width/2))*180/PI - 當求出的角度<隨著時間比例變的角度,則將新的圖覆蓋到舊的圖 - 反之,用舊的圖覆蓋舊的圖 3. 但是,這會產生一個問題,因為斜率一樣,且atan()求出的角度範圍只有-90~90度,所以一三象限或者二四象限會發生同時wi