亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 0303.c

?? 計算機圖形學
?? C
?? 第 1 頁 / 共 2 頁
字號:
   }
  q=h;
  line(sx,sy,q->dx,q->dy);
}
  mo1(void)
{
   int i;
  struct node *head,*sh,*q,*r;
  int sx,sy,color,dd,left,right,xx,xl,xr,yy,flag,xxr;
  struct point
   { int d[10][2];
     int len;
    } top,bot;
  initgr(); /* BGI初始化 */
   outtextxy(320,200,"Press any key to begin...");
   getch();
   head=create();
  draw_polo(head);
/*  scanf("%d,%d",&sx,&sy);*/
  sx=115;
  dd=105;
  left=70;
  right=220;
  sh=(struct node *)malloc(LEN);
  sh->dx=sx;
  sh->dy=dd;
  sh->next=NULL;
  while (sh!=NULL)
  { sx=sh->dx;
    sy=sh->dy;
    r=sh;
    sh=sh->next;
    free(r);
    xx=sx;
    while ((xx>left)&&(getpixel(xx,sy)!=14))
     { putpixel(xx,sy,12);
       xx=xx-1;
     }
     xl=xx=1;
    xx=sx+1;
    while ((xx<right)&&(getpixel(xx,sy)!=14))
     { putpixel(xx,sy,12);
       xx=xx+1;
     }
    xr=xx-1;
    xx=xl;
    yy=sy+1;
    xxr=left;
    while (getpixel(xxr,yy)!=14)
     xxr=xxr+1;
    while (xx<=xr)
    { flag=0;
      while ((getpixel(xx,yy)!=14)&&(getpixel(xx,yy)!=12)&&(xx<xr))
       { if (flag==0) flag=1;
     xx=xx+1;
       }
     if (flag==1)
      { if ((getpixel(xx,yy)!=14)&&(getpixel(xx,yy)!=12)&&(xx==xr))
     {
       r=(struct node *)malloc(LEN);
       r->dx=xx;
       r->dy=yy;
       r->next=sh;
       sh=r;
      }
    else
      {if (xx-1>xxr)
       {
       r=(struct node *)malloc(LEN);
       r->dx=xx-1;
       r->dy=yy;
       r->next=sh;
       sh=r;
      }
      }
      flag=0;
       }
      dd=xx;
      while (((getpixel(xx,yy)==14)||(getpixel(xx,yy)==12))&&(xx<xr))
       xx=xx+1;
      if (xx==dd) xx=xx+1;
     }

    xr=xx-1;
    xx=xl;
    yy=sy-1;
    xxr=left;
    while (getpixel(xxr,yy)!=14)
     xxr=xxr+1;
    while (xx<=xr)
    { flag=0;
      while ((getpixel(xx,yy)!=14)&&(getpixel(xx,yy)!=12)&&(xx<xr))
       { if (flag==0) flag=1;
     xx=xx+1;
       }
     if (flag==1)
      { if ((getpixel(xx,yy)!=14)&&(getpixel(xx,yy)!=12)&&(xx==xr))
     {
       r=(struct node *)malloc(LEN);
       r->dx=xx;
       r->dy=yy;
       r->next=sh;
       sh=r;
      }
    else
      {if (xx-1>xxr)
       {
       r=(struct node *)malloc(LEN);
       r->dx=xx-1;
       r->dy=yy;
       r->next=sh;
       sh=r;
      }
      }
      flag=0;
       }
      dd=xx;
      while (((getpixel(xx,yy)==14)||(getpixel(xx,yy)==12))&&(xx<xr))
       xx=xx+1;
      if (xx==dd) xx=xx+1;
     }
   }
  outtextxy(320,220,"AreaFilled Finish.");
  getch(); /* 暫停一下,看看前面繪圖代碼的運行結果 */
  closegr(); /* 恢復TEXT屏幕模式 */
  return 0;
}
/*---------------------------------------------------------------------*/
 wang1()
 {   initgr(); 
   setbkcolor(BLUE);
   setcolor(BROWN);
   settextjustify(LEFT_TEXT,0);
   settextstyle(DEFAULT_FONT,HORIZ_DIR,2);


   setcolor(RED);
   setfillstyle(1,RED);
   line(107,104,393,104);                           /*劃定區域*/
   line(162,321,393,104);
   line(250,0,162,321);
   line(250,0,338,321);
   line(107,104,338,321);                           /*繪出五角星*/
   floodfill(250,200,RED);
   floodfill(250,100,RED);
   floodfill(120,106,RED);
   floodfill(360,106,RED);
   floodfill(170,300,RED);
   floodfill(330,300,RED);                  /*填充顏色*/

 }
/*--------------------------------------Pro.5 Linewidth---------------------------------*/
void linewidth(int x0,int y0,int x1,int y1,int color,int k)
/*假定x0<x1,y0<y1,-1<m<1*/
{
  int dx, dy,incrE,incrNE,d,x,y;
  int i;
  dx=x1-x0;
  dy=y1-y0;
  d=dx-2*dy;
  incrE=-2*dy;
  incrNE=2*(dx-dy);
  x=x0;
  y=y0;
  for(i=1;i<=k;i++)
  putpixel(x,y+i,color);
  while(x<x1)
   {
    if (d>0)
     d+=incrE;
     else
     {
       d+=incrNE;
       y++;
     }
     x++;
     for (i=1;i<=k;i++)
     if(x%16>3)
     putpixel(x,y+i,color);
    }

}

  mo2(void)
{ int x0,y0,x1,y1,color,k;
  initgr(); /* BGI初始化 */


  linewidth(50,50,220,300,2,1);
  outtextxy(100,350,"Width=1.");
  getch();
  linewidth(150,50,320,300,2,3);
  outtextxy(200,350,"Width=3.");
  getch();
  linewidth(250,50,420,300,YELLOW,5);
  outtextxy(300,350,"Width=5.");
  getch();
  linewidth(350,50,520,300,YELLOW,7);
  outtextxy(400,350,"Width=7.");
  getch(); /* 暫停一下,看看前面繪圖代碼的運行結果 */
  closegr(); /* 恢復TEXT屏幕模式 */
  return 0;
}
/*------------------------Pro.6  The cut of pic------------------------------------*/
typedef int bool;



typedef struct{
               bool all;
               unsigned  left,right,top,bottom;
               }OutCode;   /*定義編碼標志*/
typedef struct{
               int xmin,xmax,ymax,ymin;
               }Rectangle;



/*Choen-Sutherland線段裁減算法*/
void  CohenSutherlandLineClip(float x0,float y0,float x1,float y1,Rectangle  *rect)
  {
   void  CompOutCode(float, float,Rectangle *,OutCode *); /*對ComOutCode函數的聲明*/
    bool accept,done;
   OutCode  outCode0,outCode1;
   OutCode *outCodeOut;
   float x,y;   /*存儲交點坐標*/
   accept=0;
   done=0;
   CompOutCode(x0,y0,rect,&outCode0);
   CompOutCode(x1,y1,rect,&outCode1);
   do{
        if(outCode0.all==0&&outCode1.all==0)  /*完全可見*/
        {accept=1;
        done=1;
        printf("the line is in the rect.");
        }
        else if((outCode0.all&outCode1.all)!=0)  /*完全不可見*/
        {done=1;
         printf("The line cannot be seen.");
        }
        else           /*進行求交測試*/
        {
          if(outCode0.all!=0)   /*判斷哪一點位于窗口之外*/
             outCodeOut=&outCode0;
           else
              outCodeOut=&outCode1;
              if(outCodeOut->left)  /*線段與窗口的左邊求交*/
              {
                y=y0+(y1-y0)*(rect->xmin-x0)/(x1-x0);
                x=(float)rect->xmin;

              }
             else if (outCodeOut->top)   /*線段與窗口的上邊求交*/
             {
               x=x0+(x1-x0)*(rect->ymax-y0)/(y1-y0);
               y=(float)rect->ymax;
             }
             else if (outCodeOut->right)  /*線段與窗口的右邊求交*/
             { y=y0+(y1-y0)*(rect->xmax-x0)/(x1-x0);
             x=(float)rect->xmax;

             }
             else if(outCodeOut->bottom)  /*線段與窗口的下邊求交*/
             {
             x=x0+(x1-x0)*(rect->ymin-y0)/(y1-y0);
             y=(float)rect->ymin;
             }
             if(outCodeOut->all==outCode0.all)/*以交點為界,將線段位于窗口外側的部分丟棄.對剩余部分裁減*/
             {
               x0=x;
               y0=y;
               CompOutCode(x0,y0,rect,&outCode0);
             }
             else
             {
               x1=x;
               y1=y;
               CompOutCode(x1,y1,rect,&outCode1);

             }
        }
   } while(!done);
   if(accept)
   line((int)x0,(int)y0,(int)x1,(int)y1);

 }


 /*計算點(x,y)的編碼*/
 void CompOutCode(float x,float y,Rectangle *rect,OutCode *outCode)
 {
  outCode->all=0;
  outCode->top=outCode->bottom=0;
  if(y>(float)rect->ymax)
  {
   outCode->top=1;
   outCode->all+=1;
  }

  else if(y<(float)rect->ymin)
  {
   outCode->bottom=1;
   outCode->all+=2;
  }

  outCode->right=outCode->left=0;
   if(x>(float)rect->xmax)
  {
   outCode->right=1;
   outCode->all+=4;
  }
  else if(x<(float)rect->xmin)
  {
   outCode->left=1;
   outCode->all+=8;
  }
}


feng()
{ float x0,y0,x1,y1;Rectangle rect;

  initgr();/*  BGI初始化 */

  printf("please input rect.xmin:");
  scanf("%d",&rect.xmin);
  printf("rect.xmax:");
  scanf("%d",&rect.xmax);
  printf("rect.ymin:");
  scanf("%d",&rect.ymin);
  printf("rect.ymax:");
  scanf("%d",&rect.ymax);

  printf("x0:");
  scanf("%f",&x0);
  printf("y0:");
  scanf("%f",&y0);
  printf("x1:");
  scanf("%f",&x1);
  printf("y1:");
  scanf("%f",&y1);
  setcolor(14);
  cleardevice();
  rectangle(rect.xmin,rect.ymin,rect.xmax,rect.ymax);
  line(x0,y0,x1,y1);
  getch();

  setcolor(BLACK);
  line(x0,y0,x1,y1);

   /*畫出矩形裁剪窗口*/
  setcolor(YELLOW);
  CohenSutherlandLineClip(x0,y0,x1,y1,&rect); /*調用函數*/
  getch();
  /*closegraph();   關閉*/
}
/*-----------------------------------Pro. 7  The character-------------------*/
 wang2()
 { initgr();
   line2(50,50,550,50,9);
   line2(50,100,550,100,9);
   line2(50,150,177,150,9);line2(383,150,550,150,9);
   line2(50,200,550,200,9);
   line2(50,250,285,250,9);line2(315,250,550,250,9);
   line2(50,300,285,300,9);line2(315,300,550,300,9);
   line2(50,350,285,350,9);line2(315,350,550,350,9);
   line2(50,400,550,400,9);                    /*背景線*/
   setcolor(YELLOW);
   line(285,75,285,375);
   line(285,75,315,75);
   line(315,75,315,375);
   line(285,375,315,375);
   line(393,122,217,122);
   line(210,152,393,152);
   line(393,152,393,122);
   line(134,220,466,220);
   line(134,250,466,250);
   line(134,220,134,250);
   line(466,220,466,250);
   line(190,100,170,175);
   line(170,175,210,152);
   line(190,100,230,100);
   line(230,100,217,122);
   setfillstyle(1,YELLOW);
   floodfill(286,76,YELLOW);
   floodfill(286,123,YELLOW);
   floodfill(300,199,YELLOW);
   floodfill(300,240,YELLOW);
   floodfill(286,374,YELLOW);
   floodfill(216,123,YELLOW);
   floodfill(382,123,YELLOW);
   floodfill(135,229,YELLOW);
   floodfill(465,229,YELLOW);
   setcolor(RED);
   settextjustify(LEFT_TEXT,0);
   settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
 }


int main(void)
{ int n;
  loop1:initgr(); /* BGI初始化 */

  outtextxy(50,50,"***************************************************************");
  outtextxy(50,300,"***************************************************************");
  outtextxy(90,280,"WELCOME YOU!!");
  setbkcolor(BLUE);
  getch();
  outtextxy(70,70,"Pro.1    The DDALine and MidLine");
  outtextxy(90,90,"Pro.2    The Bezier curve ang B yangtiao curve");
  outtextxy(110,110,"Pro.3    The Midcircle,DDAcircle and DDAEllipse");
  outtextxy(130,130,"Pro.4    The AreaFilled");
  outtextxy(150,150,"Pro.5    The Linewidth");
  outtextxy(170,170,"Pro.6    The cut of the pic");
  outtextxy(190,190,"Pro.7    The character");
  outtextxy(210,210,"Pro.8    EXIT");
  outtextxy(90,280,"WELCOME YOU!!");
  getch();
  outtextxy(110,240,"Please input a number...");

  scanf("%d",&n);

  loop2:switch (n)
    {
   case 1:{zheng();
       goto loop1;break;
       }
   case 2:{liu();
       goto loop1;break;
       }
   case 3:{tang();
       goto loop1;break;
       }
   case 4:{mo1();
       /*wang1();
       getch();*/
       goto loop1;break;
       }
   case 5:{mo2();
       goto loop1;break;
       }
   case 6:{feng();
       goto loop1;break;
       }
   case 7:{wang2();
       getch();
       outtextxy(220,220,"That's all! Thank you!!");
       getch();
       goto loop1;break;
       }
   case 8:exit();break;
   default:{outtextxy(90,260,"INPUT ERROR!!Please input again!");
            scanf("%d",&n); goto loop2;
            }
      }

  /*****此部分添加你自己的代碼,例如
  line(25, 25, 220, 220);
  circle(100, 100, 50);
  等等*****/

  getch(); /* 暫停一下,看看前面繪圖代碼的運行結果 */
  closegr(); /* 恢復TEXT屏幕模式 */
  return 0;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本欧美在线看| 亚洲毛片av在线| 久久看人人爽人人| 亚洲欧美日韩精品久久久久| 国产精品国产三级国产有无不卡 | 免费看日韩精品| 国产精品资源在线观看| 国产精品1区2区3区| 日本精品免费观看高清观看| 欧美日韩国产综合草草| 久久亚洲精精品中文字幕早川悠里 | 亚洲精品一区二区三区蜜桃下载| 精品国产99国产精品| 亚洲韩国精品一区| gogogo免费视频观看亚洲一| 日韩欧美自拍偷拍| 一区二区三区四区五区视频在线观看| 日韩成人一级片| 精品免费国产一区二区三区四区| 亚洲欧美色一区| gogogo免费视频观看亚洲一| 欧美成人bangbros| 青青草国产精品亚洲专区无| 91黄视频在线| 亚洲丝袜自拍清纯另类| 大尺度一区二区| 26uuu国产一区二区三区| 五月激情丁香一区二区三区| 91国偷自产一区二区三区成为亚洲经典 | 亚洲综合色自拍一区| voyeur盗摄精品| 亚洲精品国产第一综合99久久| 国产高清亚洲一区| 精品欧美一区二区三区精品久久| 日韩精品欧美精品| 日韩欧美中文一区| 久久综合综合久久综合| 制服丝袜在线91| 免费观看30秒视频久久| 欧美久久久久久蜜桃| 麻豆91精品视频| 国产欧美日韩视频一区二区 | 日本一区二区三区视频视频| 成人午夜激情视频| 亚洲一区二区综合| 日韩精品最新网址| 国产91精品欧美| 亚洲一区二区三区在线看| 在线观看91av| 国产成人av电影| 亚洲成人自拍偷拍| 久久久亚洲欧洲日产国码αv| 97se亚洲国产综合自在线不卡| 日韩精品视频网| 日本一区二区电影| 欧美一二三区精品| 91在线精品一区二区| 理论片日本一区| 亚洲一级二级在线| 最新日韩在线视频| 欧美激情在线一区二区三区| 51午夜精品国产| 91麻豆国产福利在线观看| 免费观看在线综合| 石原莉奈在线亚洲二区| 国产精品美女久久久久久久 | 久久不见久久见免费视频7| 亚洲激情自拍偷拍| 国产精品久久久久国产精品日日| 欧美一区二区网站| 欧美日韩在线免费视频| 一本到不卡精品视频在线观看| 精品夜夜嗨av一区二区三区| 99精品视频在线观看| 国产美女精品在线| 一区二区三区美女视频| 久久精品亚洲国产奇米99| 69堂亚洲精品首页| 在线播放中文一区| 91.xcao| 日韩一区二区电影在线| 日韩免费一区二区三区在线播放| 欧美猛男男办公室激情| 91精品国产乱| 欧美成人国产一区二区| 久久午夜免费电影| 综合精品久久久| 一区二区三区蜜桃| 日本成人在线看| 成人午夜视频免费看| 91麻豆国产在线观看| 91麻豆精品国产91久久久久| 日韩视频免费观看高清完整版在线观看| 日韩精品一区二区三区视频| 久久综合精品国产一区二区三区 | 欧美色图激情小说| 国产欧美日韩三区| 日韩精品国产欧美| 99在线热播精品免费| 在线成人小视频| 亚洲欧美日韩成人高清在线一区| 青椒成人免费视频| 91蜜桃免费观看视频| 欧美mv日韩mv国产| 国产女主播视频一区二区| 国产精品12区| 欧美精品一区男女天堂| 一区二区免费在线| 成人国产精品免费观看动漫| 666欧美在线视频| 亚洲精品写真福利| 丁香激情综合国产| 久久精品一级爱片| 麻豆精品视频在线观看视频| 欧美日韩日本视频| 亚洲在线成人精品| 色噜噜夜夜夜综合网| 中日韩免费视频中文字幕| 国产一区二区在线观看视频| 欧美一级精品在线| 日本系列欧美系列| 日韩欧美的一区二区| 麻豆精品一区二区av白丝在线| 欧美日韩国产另类不卡| 亚洲一级电影视频| 欧美日韩中文字幕一区| 亚洲高清视频的网址| 欧美日韩高清一区二区不卡| 性做久久久久久| 日韩欧美电影一二三| 国产精品一区二区91| 中文字幕第一区第二区| 欧美日韩成人综合天天影院 | 欧美激情一区二区三区四区| 国产一区二区三区精品视频| 久久婷婷色综合| 国产成人免费视频网站高清观看视频| 久久精品一区二区| 日本道在线观看一区二区| 亚洲午夜久久久久中文字幕久| 欧美日韩精品一区二区| 国产福利视频一区二区三区| 中文字幕一区二区三区四区不卡 | 国产福利91精品| 亚洲小说欧美激情另类| 久久尤物电影视频在线观看| 波波电影院一区二区三区| 日韩国产精品久久久| 中文字幕av不卡| 欧美mv日韩mv亚洲| 欧美日韩一区二区三区四区五区| 久久爱www久久做| 亚洲欧美日韩久久| 欧美国产精品中文字幕| 欧美日韩国产色站一区二区三区| 国产成人夜色高潮福利影视| 五月天丁香久久| 亚洲人成在线观看一区二区| 精品国产伦一区二区三区观看方式 | 亚洲精品视频在线| 亚洲精品一区二区三区香蕉| 91精品中文字幕一区二区三区| 99re这里只有精品6| 国产成人综合在线观看| 秋霞电影一区二区| 亚洲第一成年网| 亚洲综合色自拍一区| 亚洲精品日韩综合观看成人91| 久久久久久久综合日本| 国产亚洲综合av| 中文字幕第一区二区| 国产精品传媒入口麻豆| 亚洲色图20p| 亚洲一区二区偷拍精品| 亚洲一区二区不卡免费| 天堂午夜影视日韩欧美一区二区| 丝袜亚洲另类丝袜在线| 精品一区二区久久| 成人精品亚洲人成在线| 91美女片黄在线| 欧美理论电影在线| 精品嫩草影院久久| 亚洲免费观看视频| 亚洲妇女屁股眼交7| 免费xxxx性欧美18vr| 丁香婷婷综合色啪| 色婷婷综合五月| 日韩情涩欧美日韩视频| 国产精品高潮呻吟久久| 日本亚洲欧美天堂免费| 成人av资源在线观看| 制服丝袜日韩国产| 亚洲人成伊人成综合网小说| 日韩国产欧美三级| av高清不卡在线| 欧美一区二区日韩| 亚洲一区二区成人在线观看| 福利一区二区在线| 91精品国产欧美一区二区| 国产精品欧美一级免费|