计算机图形学(20190417162814).docxVIP

  • 1
  • 0
  • 约9.02千字
  • 约 7页
  • 2019-04-18 发布于安徽
  • 举报
计 算 机 图 形 学 姓名:李倩倩 班级:硕研 10-14 学号: 2010011427 第一题: #include afxwin.h #include math.h void MidpintLine( HDC hDC,int x1,int y1,unsigned long color) { int a,b,delta1,delta2,d,x,y; a=y0-y1; b=x1-x0; d=2*a+b; delta1=2*a;  x0,int  y0,int  else yinc=-1; dx=abs(dx);dy=abs(dy); int x=xs,y=ys; int i=0; if(dx==0dy==0) SetPixel(pdc,x,y,color); SetPixel(hDC,x,y,color); else if(dx==0) { delta2=2*(a+b); x=x0;  for(i=0;idy;i++) { y=y0; SetPixel(hDC,x,y,color);  while(xx1)  SetPixel(pdc,x,y,color); y+=yinc; {  } if(d0) { x++;  } else if(dy==0) { y++; d+=delta2;  for(i=0;idx;i++) { }  else  SetPixe

文档评论(0)

1亿VIP精品文档

相关文档