正在加载图片...
算法的程序实现如下 函数Cohen Suther I and,用来实现算法 函数makecode)用来编码,利用数值位运算 double xI,xr,yt,yb;(事先给出窗口的 位置,四个数值是已知的) void Cohen Sutherland(double x0,y0,x2,y2) { int c,cl,c2; double x,y; makecode(x0,y0,c1);makecode(x2,y2,c2); while(c1!=0‖c2!=0) if (c1&c2!=0)return; 算法的程序实现如下 函数Cohen_Sutherland用来实现算法 函数makecode用来编码,利用数值位运算 double xl, xr, yt, yb; (事先给出窗口的 位置,四个数值是已知的) void Cohen_Sutherland(double x0, y0, x2, y2) { int c, c1, c2; double x, y; makecode(x0, y0,c1); makecode(x2, y2, c2); while (c1!=0 || c2!=0) { if (c1&c2!=0) return;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有