- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
计算机图形学课程设计 计算机图形学课程设计 PAGE PAGE # / 11 计算机图形学课程设计 运行环境turboc2. 0 本程序完成了橡皮筋直线,橡皮筋圆,橡皮筋矩形框,多边形裁剪和3阶B曲絞 的作图,且有比较友好的界面 #ifndef _GRAPHICS_C_ 曲efine _GRAPHICS_C_ #endif 甘define _MOUSE #define CIRCLE 1 甘define LINE 2 ^define RECTANGLE 3 #include stdio. h” ttinclude string, h” #include/zgraphics. h〃 #include zmath. h〃 int flag, num; int x, y, oldx, oldy, px, py; int a[4],b[4]; char string[120]; char zuobiao[20]: #include dos. h union REGS inreg, outreg; struct SREGS sr; void _mytreat (int, int, int, int); void _write(char*): void mycross(int x, int y) { setcolor(15); outtextxy(500, 468, zuobiao); sprintf (zuobiao, 〃x=%d, y=%d, x, y); setcolor(8); outtextxy(500, 468, zuobiao); line(x~3, y-3, x+3, y+3); 1 ine (x+3, y-3, x-3, y+3); ) void mycircle(double x, double y, double r) { double i: for(i=0. 0;i360. 0;i=i+4) line(x+r*cos((i+1)/360*3. 1415*2), y+r*sin((i+l)/360*3. 1415*2), x+r*cos( (i+4. 0)/360*3. 1415*2), y+r*sin((i+4. 0)/360*3. 1415*2)); ) void _Bezer(int a[3], int b[3], int ( int k, n, aO, al, a2, a3, bO, bl, b2, b3, x, y; double i, t; setwritemode(0); a0=(a[m%4]+4*a[m%4+l]+a[m%4+2])/6; al=(a[m%4+2]-a[m%4])/2; a2=(a[m%4]-2*a[m%4+1]+a[m%4+2])/2; a3=-(a[m%4]~3*a[m%4+l]+3*alm%4+2]-aim%4+3J)/6; b0=(b[m%4]+4*b[m%4+l]+b[m%4+2])/6; bl=(b[m%4+2]-b[m%4])/2; b2=(b[m%4]-2*b[m%4+l]+b[m%4+2])/2; b3二-(b[m%4]-3*b[m%4+l]+3*b[m%4+2]-b[m%4+3]) /6; for(i=0:i3;i+=0. 1) { t=i/3: x=a0+a1*t +a2*t*t+a3*t*t *t; y=bO+b1*t+b2*t*t+b3*t*t*t: if (i=0)moveto(x, y): lineto(x, y); ) set writ emode (1); } void DisplayMouseO { inreg. x. ax=l; int86(0x33, ftinreg, Soutreg); } void CloseMouseO { inreg. x? ax=2; int86(0x33, ftinreg, Aoutreg); union REGS DisplayMouseStatus() { inreg. x. ax=3; int86(0x33, ftinreg, Soutreg); return outreg: } void meun(int x, int y, char *str) setcolor(8); outtextxy(x+5, 28, str); setcolor(15); 1 ine (x, 22, x, 40); line(x, 22, y, 22); setcolor (8): line(x, 40, y, 40): line(y, 22, y, 10); ) void drawwindows () ( setbkcolor(7): /*7*/ setcolor(8); rectangle (0, 20, 610, 160
有哪些信誉好的足球投注网站
文档评论(0)