计算机图形学程序 你想要什么嘛,我这学期也学了计算机图形学的,什么直线圆啊我都有includeincludevoid Put(int x,int y,int w,int c){int i,j;j=w/2;for(i=y-j;i;i+)putpixel(x,i,c);}void BresenhamLine(int x1,int y1,int x2,int y2,int width,int color){int dx,dy,x,y,d,d1,d2,inc,tmp;dx=x2-x1;dy=y2-y1;if(dx*dy>;=0)inc=1;else inc=-1;if(abs(dx)>;abs(dy)){if(dx){tmp=x1;x1=x2;x2=tmp;tmp=y1;y1=y2;dx=-dx;dy=-dy;}d=2*dy-dx;d1=2*dy;d2=2*(dy-dx);x=x1;y=y1;Put(x,y,width,color);while(x){x+;if(d)d+d1;else{y+inc;d+d2;}Put(x,y,width,color);}}else{if(dy){tmp=x1;x1=x2;x2=tmp;tmp=y1;y1=y2;dx=-dx;dy=-dy;}d=2*dx-dy;d1=2*dx;d2=2*(dx-dy);x=x1;y=y1;Put(x,y,width,color);while(y){y+;if(d)d+d1;else{x+inc;d+d2;}Put(x,y,width,color);}}}void main(){int gdriver=DETECT,gmode,x1,x2,y1,y2,c,w;initgraph(&gdriver,&gmode,\"\");printf(\"Please enter the point of head and rear:\");scanf(\"%d%d%d%d\",&x1,&y1,&x2,&y2);printf(\"the color:\");scanf(\"%d\",&c);printf(\"the width:\");scanf(\"%d\",&w);BresenhamLine(x1,y1,x2,y2,。
求计算机图形学中画线和圆程序的源代码? vc画线和画圆都在win32回调函数中的WM_PAINT中执行:case WM_PAINT:/画线MoveToEx(hdc,p1.x,p1.y,NULL);起始点p1的坐标,hdc当前窗口句柄LineTo(hdc,p2.x,p2.y);从p1点往p2点画线/画圆Ellipse(hdc,p3.x,p3.y,p4.x,p4.y);p3,p4为圆的外切矩形的左上和右下坐标
急求计算机图形学源程序!!! 这是《计算机图形学》这本书附带的源码,里面算法不少,纯C。
计算机图形学OpenGL版第三版的源码谁有啊? http://www.4twk.com/shill/3rd-edition.html