计算机图形学实验报告.docVIP

  • 27
  • 0
  • 约8千字
  • 约 10页
  • 2023-09-13 发布于湖北
  • 举报
班级:10计科 姓名:敖智挺 学号:201030457117 实验一 直线生成与二次曲线拟合 实验内容: 应用 Bresenham画线算法实现一程序,完成直线生成。 实验目的: 1. 了解掌握VC下2D图元的扫描转换原理及VC实现; 2. 掌握图元属性原理及VC编程实现方法; 3. 掌握图元区域填充原理及模式,并验证实现相应的图元填充算法。 实验源代码: #includemath.h #include graphics.h #include conio.h main() { int driver=DETECT; int mode; int x1,y1,x2,y2; initgraph(driver,mode,); x1=100;y1=200;x2=400;y2=300; bsrline(x1,y1,x2,y2,4); getch(); closegraph(); } bsrline(int x1,int y1,int x2,int y2,int c) { int dx,dy; int x, y; int p; int delta_p1,delta_p2; int inc; int tmp; dx=x2-x1; dy=y2-y1; if((dx=0 dy=0)||(dx0 dy0)) inc=1; else inc=-1; if(abs(d

文档评论(0)

1亿VIP精品文档

相关文档