Вторник, 14.05.2024, 21:10
Приветствую Вас Гость | RSS
Главное меню
Наш опрос
Оцените мой сайт
Всего ответов: 47
Форма входа
Категории раздела
Поиск
Статистика

Онлайн всего: 1
Гостей: 1
Пользователей: 0

Графика в Паскале

Каталог файлов

Главная » Файлы » Мои файлы

kolobok.pas
[ Скачать с сервера (3.6 Kb) ] 22.06.2014, 14:34

uses crt, graph;

Procedure rech;
const treu:array[1..4] of PointType =
      ((x:340;y:280), (x:360;y:320), (x:300;y:300), (x:340;y:280));
 begin
  setcolor(15);
  setfillstyle(1,15);
  fillellipse(250,260,130,70);    {®ў «}

  fillpoly(4,treu); floodFill(350,310,15);   {ваҐгЈ®«м­ЁЄ}

  setcolor(9);
  settextstyle(1,2,2);

  settextjustify(1,0);
  OuttextXY(250,260,'Thanks for your');

  settextjustify(1,2);
  OuttextXY(250,260,'attention !!!');

 end;

Procedure kolobok_okno(x,y,alpha:integer);
var xxL,xxR,yyL,yyR,xx,yy:integer;
    ugol:real;
 begin                setlinestyle(0,0,3);
 ugol:=pi/180*alpha;

 xxL:=round(abs(x-(x-40))*cos(ugol)-abs(y-(y-40))*sin(ugol));
 xxR:=round((x-(x+40))*cos(ugol)-abs(y-(y-40))*sin(ugol));
 yyL:=round(abs(x-(x-40))*sin(ugol)+abs(y-(y-40))*cos(ugol));
 yyR:=round((x-(x+40))*sin(ugol)+abs(y-(y-40))*cos(ugol));

 //xx:=round(abs(x-(x))*cos(ugol)-abs(y-(y+20))*sin(ugol));
 //yy:=round(abs(x+(x))*sin(ugol)+abs(y-(y+20))*cos(ugol));

  setcolor(14); setfillstyle(1,14);
  FillEllipse(x,y,100,100);     {Є®«®Ў®Є}
    setcolor(8);
    setfillstyle(1,15);
    fillEllipse(x+xxL,y-yyL,20,20);
    fillEllipse(x+xxR,y-yyR,20,20); {Ј« § }

    setcolor(9);
    setfillstyle(1,1);
    fillEllipse(x+xxL,y-yyL,10,10);
    fillEllipse(x+xxR,y-yyR,10,10); {§а зЄЁ}

  setcolor(8);
  setfillstyle(1,6);
  fillellipse(x,y,10,10);  {­®б}

  if alpha<180 then begin
    arc(x,y,180+alpha,360{+alpha},50);
    arc(x,y,0,0+alpha,50);     end;

  if (alpha>180) and (alpha<360) then begin
    arc(x,y,0+alpha,180+alpha,50);     end;

  if alpha>=360 then arc(x,y,180,360,50);

    //writeln(180+alpha,'   ',360+alpha);


 end;


Procedure zemlya;
var    i,f,j:integer;
 begin
  for i:=1 to 1200 do
   begin
    f:=trunc(sin(i/30)*10);
    for j:=1 to 70 do
     putpixel(i-30,f+500+j,10);

   // floodfill(500,500,10);
   end;

 end;

Procedure Dom;
const  dx=100;
krisha:array[1..4] of pointtype =
      ((x:580+dx;y:220), (x:750+dx;y:80), (x:920+dx; y:220), (x:580+dx;y:220));


 begin          setlinestyle(0,1,3);
    setcolor(6);
    setfillstyle(1,6);
    bar(840+dx,100,880+dx,200);   {вагЎ }

    setcolor(5);
    setfillstyle(7,4);
    bar(600+dx,220,900+dx,520);   {¤®¬2}

     setcolor(13);
  setfillstyle(4,13);
  fillpoly(3,krisha);      {Єали 2}
  FloodFill(750+dx,150,13);

  setcolor(9);
  setfillstyle(1,9);
  bar(660+dx,280,840+dx,440); {®Є­®}

  setcolor(1);
  line(750+dx,280,750+dx,440);
  line(660+dx,360,840+dx,360)

 end;

 

procedure sun;
var i:integer; x,y:integer;
 begin
  setcolor(14);
  setfillStyle(1,14);
  Randomize;
  FillEllipse(0,0,100,100); //x:=random(150);
  y:=1;
  i:=1;
   while i<90 do
    begin
     line(0,0,round((random(350)+100)*cos(pi/180*i)-y*sin(pi/180*i)),
              round((random(350)+100)*sin(pi/180*i)+y*cos(pi/180*i)));
    i:=i+3;
    end;


 end;


Var D,m : integer;
    strX,strY:string;
    i:integer;   f:integer;

Begin             clrscr;
   D:= detect;
   InitGraph(d,m,'');
                        setViewPort(0,0,1023,550,true);
                        setBKcolor(1); cleardevice;

   for i:=360 to 400 do
   begin   if i=1 then readln;

      f:=trunc(sin(i/30)*10);
                    if i<=360 then kolobok_okno(660-i+150,f+400,i)
                    else kolobok_okno(660-360+150,f+400,0);

   sun; dom;  zemlya;

                                if i >= 361 then  rech;
   if i<=399 then begin
   delay(1000);
   cleardevice; end;


   end;

 

 

            readln;

 

       CloseGraph;

end.

Категория: Мои файлы | Добавил: zhekin_new
Просмотров: 1513 | Загрузок: 73 | Комментарии: 1 | Рейтинг: 0.0/0
Всего комментариев: 0
Имя *:
Email *:
Код *: