资源描述:
《计算机图形学 飘动的红旗》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include#include#include#include#include#include#defineUP 18432#defineDOWN20480#defineESC 283#definePI 3.1415926#defineS 8051voidxing(doubleox,doubleoy,doubler){ doublepointx[5],pointy[5],r1; doublepointx1[5],pointy1[5]; i
2、nti,j,k; r1=r*sin((18/180.0)*PI)/cos((36/180.0)*PI); for(i=0;i<5;i++) { pointx[i]=ox+r*sin((72/180.0)*PI*i); pointy[i]=oy-r*cos((72/180.0)*PI*i); } for(i=0;i<5;i++) { pointx1[i]=ox+sin(((72*i+36)/180.0)*PI)*r1; pointy1[i]=oy-cos(((72*i+36)/180.0)*PI)*r1;
3、 } setcolor(14); for(i=0;i<5;i++) { line(pointx[i],pointy[i],pointx1[i],pointy1[i]); line(pointx1[i],pointy1[i],pointx[(i+1)%5],pointy[(i+1)%5]); } setfillstyle(1,14); floodfill(ox,oy,14);}voidqi1(doubletx,doublety){ doublex; setcolor(4); moveto(tx,ty); for(
4、x=0.0;x5、fill(tx+10,ty+10,4); setcolor(14); setlinestyle(0,0,3); line(tx,ty,tx,ty+300); xing(tx+40,ty+40.0,25); xing(tx+85.0,ty+20.0,8); xing(tx+90.0,ty+45.0,8); xing(tx+70.0,ty+70.0,8); xing(tx+30.0,ty+80.0,8);}voidqi2(doubletx,doublety){ doublex; setcolor(4); moveto(tx,ty);
6、 for(x=0.0;x7、floodfill(tx+10,ty+10,4); setcolor(14); setlinestyle(0,0,3); line(tx,ty,tx,ty+300); xing(tx+40,ty+40.0,25); xing(tx+85.0,ty+20.0,8); xing(tx+90.0,ty+45.0,8); xing(tx+70.0,ty+70.0,8); xing(tx+30.0,ty+80.0,8);}voidwelcome(){ intmaxx,k;