uses crt,graph,mouse,Engine; var Cl:array[1..100,1..100] of byte; x,y,z: array[1..400,1..8] of integer; l,l0,ly,l0y: real; xt,yt,zt:real; a,ay:integer; p,h,hy,o:real; zk,yk,xk:integer; i,k,d,x1,y1,z1,m:integer; s,s1,s2,s3,s4,s5,s6:string; pg:word; gd,gm:integer; c:char; mx,my,mx0,my0:integer; {-----------------ПРОЦЕДУРЫ------------------} {--------------------------------------------} {------------Рисование плоскости-------------} {--------------------------------------------} procedure DrawPlane(xc,yc,zc:real; Sa,Sb:integer; RotXZ,RotYZ:real; Color:Byte); var x,y,z:array[1..4] of real; pl:array[1..4] of pointtype; f,q1,q2,q3,q4,q5,q6:integer; l:integer; TgAy,SinAy,CosAy,CosA,SinA:integer; m,k,k1,r:integer; i,j,g:integer; Zd,Xd,Yd,UgoL:real; begin FOR I:=1 TO Sb DO BEGIN FOR J:=1 to Sa DO BEGIN if (j=1)and(i=1) then begin x[1]:=round((Xc-Sa/2)*100); y[1]:=round((Yc-Sb/2+i)*100); z[1]:=round(zc*100); x[2]:=round((Xc-Sa/2+2)*100); y[2]:=round((Yc-Sb/2+i)*100); z[2]:=round(zc*100); x[3]:=round((Xc-Sa/2+2)*100); y[3]:=round((Yc-Sb/2+i+2)*100); z[3]:=round(zc*100); x[4]:=round((Xc-Sa/2)*100); y[4]:=round((Yc-Sb/2+i+2)*100); z[4]:=round(zc*100); end; if (j=1)and(i>1) then begin y[1]:=y[4]; y[2]:=y[3]; y[3]:=y[2]+2*100; y[4]:=y[1]+2*100; x[1]:=round((xc-sa/2)*100); x[4]:=x[1]; x[2]:=x[1]+2*100; x[3]:=x[2]; end; DrawPixel(a,ay,xt,yt,zt,round(x[1]/100),round(y[1]/100),round(z[1]/100),Cl[i][j]); x[1]:=x[2]; x[4]:=x[3]; x[2]:=x[1]+2*100; x[3]:=x[3]+2*100; END; END; end; Procedure DrawCube(Xc,Yc,Zc,A,V,H:Real; Color:Byte); var lm:array[1..4] of real; i:integer; id:integer; t:array[1..4] of boolean; n:array[1..4] of integer; f:integer; begin lm[1]:=sqrt(sqr(xt-xc)+sqr(yt-yc)+sqr(zt-(zc-V/2))); lm[2]:=sqrt(sqr(xt-xc)+sqr(yt-yc)+sqr(zt-(zc+V/2))); lm[3]:=sqrt(sqr(xt-(xc+a/2))+sqr(yt-yc)+sqr(zt-zc)); lm[4]:=sqrt(sqr(xt-(xc-a/2))+sqr(yt-yc)+sqr(zt-zc)); for i:=1 to 4 do t[i]:=false; f:=0; for i:=1 to 4 do begin for id:=1 to 4 do begin if (lm[i]80*p then ay:=round(80*p*100); if ay/100<-80*p then ay:=round(-80*p*100); { if (a/100>2*pi)or(a/100<-2*pi) then a:=0; {-----------------------------------} {-----------------------------------} {--------Чтение нажатых клавиш----------} k:=1; if keypressed then begin c:=readkey; case c of 'w': begin zt:=zt+5*cos(a/100); xt:=xt+5*sin(a/100); end; 's': begin zt:=zt-5*cos(a/100); xt:=xt-5*sin(a/100); end; 'd': begin xt:=xt+5*cos(a/100); zt:=zt-5*sin(a/100); end; 'a': begin xt:=xt-5*cos(a/100); zt:=zt+5*sin(a/100); end; 'q': begin yt:=yt-3; end; 'e': begin yt:=yt+3; end; {'r': inc(asd,1); 'f': dec(asd,1); } end; end; {--Выведение изображения на экран--} {--С помощью графических страниц---} clearpage; {DrawLine(0,100,100,100,100,100,red); {DrawTriangle(-100,0,100,100,0,100,0,100,300,red); }DrawPlane(0,100,100,100,100,0,0,32); {DrawCube(300,100,300,300,100,200,red); {for i:=1 to 100 do DrawPixel(i+100,200,200,Black); {DrawPixel(0,100,99,Blue); } DrawFly; outtextxy(10,10,s1); outtextxy(10,23,s2); outtextxy(10,36,s3); outtextxy(10,49,s4); outtextxy(10,62,s5); setactivepage(pg); inc(pg); if pg=7 then pg:=1; setvisualpage(pg,true); {------------------------------------} {------------------------------------} mx0:=mx; my0:=my; MoveMouseCenter; until c=#27; restorecrtmode; end.