1.DDA算法 DDA(Digital Differential Analyer):数字微分法 DDA算法思想:增量思想 公式推导: 效率:采用了浮点加法和浮点显示是需要取整 代码: void lineDDA(int x0, int y0, int x1, int y1, int color){ int x; float dy, dx, y, m; dx = x1 - x0; dy = y1 - y0; m = dy / dx; y = y0; for (x = x0; x <= x1; x++…
最近严重感觉到数学知识的不足! http://bbs.gameres.com/showthread.asp?threadid=10509 [译]Mathematics for Computer Graphics Mathematics for Computer Graphics数学在计算机图形学中的应用Greg Turk, August 1997 “学习计算机图形学需要多少的数学?”这是初学者最经常问的问题.答案取决于你想在计算机图形学领域钻研多深.如果仅仅使用周围唾手可得的图形软件,你不需要知…
1 函数 1.1 数的概述 发现不断进行加法运算,为了提高代码的复用性,就把该功能独立封装成一段独立的小程序,当下次需要执行加法运算的时候,就可以直接调用这个段小程序即可,那么这种封装形形式的具体表现形式则称作函数. 练习:把两个整数相加: public class FunctionDemo1{ public static void main(String[] args){ /* int a = 4+5; System.out.println("a="+a); int b = 3+9…