|
|
----
program ThreeDimensionalRotations;
uses graph,crt;
type sur=record
a,b,c:integer;
end;
const objekt :array[1..48] of integer=(-50,-50,-50, 50,-50,-50, 50,-50,50, -50,-50,50, -50,-50,-50, -50,50,-50, 50,50,-50,
50,-50,-50, 50,50,-50,
50,50,50, 50,-50,50, -50,-50,50, -50,50,50, -50,50,-50, -50,50,50, 50,50,50 );
var driv,mo,no_of_vectors :integer;
dstep,loop,d,mx,my,mz,sty,stx,fun,fun2 :integer;
x,y,z,sx,sy:real;
var rmax,stp1,stp2,stp3,r1,r2,r3,sr1,sr2,sr3,cr1,cr2,cr3,xa,ya,za : real;
quota :boolean;
procedure HC;
begin
Window(1,1,1,1);
TextColor(0);
TextBackGround(0);
ClrScr;
end;
procedure SC;
begin
Window(1,1,80,25);
TextColor(LightGray);
TextBackGround(0);
ClrScr;
end;
procedure counting(var x,y,z,sx,sy:real);
begin
sr1:=sin (r1);
cr1:=cos (r1);
sr2:=sin (r2);
cr2:=cos (r2);
sr3:=sin (r3);
cr3:=cos (r3);
xa:=cr1*x-sr1*y;
ya:=sr1*x+cr1*y;
x:=cr2*xa+sr2*z;
za:=cr2*z-sr2*xa;
y:=cr3*ya-sr3*za;
z:=sr3*ya+cr3*za;
x:=x+mx;
y:=y+my;
z:=z+mz;
sx:=d*x/y;
sy:=d*z/y;
end;
begin
CheckSnow := True;
writeln ('Made by TOMAS HALGAS from II.D');
writeln ('1.st assistent - A. KANSKY');
d:=0;mx:=0;my:=250;mz:=0;stp1:=4/180*pi;stp2:=stp1;stp3:=stp1;rmax:=360/180*pi;
dstep:=5;
stx:=320;
sty:=200;
no_of_vectors:=16;
quota:=false;
detectgraph(driv,mo);
initgraph(driv,mo,'');
if grok<>0 then halt;
repeat
fun:=1;
x:=objekt[fun]; {Staring point }
y:=objekt[fun+1];
z:=objekt[fun+2];
counting(x,y,z,sx,sy);
moveto (trunc(stx+sx),trunc(sty+sy));
fun:=fun+3;
repeat {Drawing object}
x:=objekt[fun];
y:=objekt[fun+1];
z:=objekt[fun+2];
counting(x,y,z,sx,sy);
lineto(trunc(stx+sx),trunc(sty+sy)); {x1,y1,x2,y2 ; 0,0 is in left up corner}
fun:=fun+3;
until keypressed or (fun div 3=no_of_vectors);
asm { Tato speci rutinka pridana MANIACom sluzi}
push ax { na v PASCALe nemoznu vec - synchronizaciu }
push bx { programu s lucom obrazovky - to moze pochopit}
push cx { len pan profesor Keket.}
push dx { cx = kolko frameov ma cakat}
push si
push di
mov cx,2
@@0:
mov dx,3dah
@@1:
in al,dx
test al,8
jnz @@1 {;wait until Verticle Retrace starts}
@@2:
in al,dx
test al,8
jz @@2 { ;wait until Verticle Retrace Ends }
loop @@0
pop di
pop si
pop dx
pop cx
pop bx
pop ax
end;
cleardevice;
r1:=r1+stp1; {Every picture}
r2:=r2+stp2;
r3:=r3+stp3;
d:=d+dstep;
if (d>500) or (d<0) then dstep:=-dstep ;
{ if (r1>rmax) or (r1<0) then stp1:=-stp1 ;
if (r2>rmax) or (r2<0) then stp2:=-stp2 ;
if (r3>rmax) or (r3<0) then stp3:=-stp3 ;
}
until keypressed;
delay(1000);
closegraph;
writeln(' External error e{412}: INTELIGENCE NOT FOUND!');
writeln(' QUICKLY PRESS CTRL+ALT+DEL!!!');
HC;
CheckBreak:= false;
repeat
repeat until keypressed;
until readkey = #1;
SC;
end.
|
|