uses crt, graph; var i,t,d,aq,sw:integer; q,q1,yd,m:real; x,y,z:array[1..800]of real; x1,y1,z1:array[1..800]of real; begin aq:=vga; sw:=vgahi; initgraph (aq,sw,''); {make sphere} q1:=-pi/2+pi/10; for t:=0 to 9 do begin q:=0; for i:=0 to 15 do begin x[t*16+i+1]:=cos(q)*cos(q1)*50; y[t*16+i+1]:=sin(q)*cos(q1)*50; z[t*16+i+1]:=sin(q1)*50; q:=q+pi/7.5; end; q1:=q1+pi/10; end; q:=0.025; q1:=0.022; yd:=pi; {mashtab} m:=1; repeat {halt} asm mov dx,3dah; @wait: in al,dx; test al,8; jz @wait; end; {delete sphere} for i:=1 to 144 do putpixel (round(x[i]*m)+320, round(y[i]*m+sin(yd)*50)+300,0); {jump add} yd:=yd+pi/32; if yd>pi*2 then yd:=pi; for i:=1 to 144 do begin {rotate x} y1[i]:=cos(q)*y[i]-sin(q)*z[i]; z1[i]:=sin(q)*y[i]+cos(q)*z[i]; y[i]:=y1[i]; z[i]:=z1[i]; {rotate y} x1[i]:=sin(q)*z[i]+cos(q)*x[i]; z1[i]:=cos(q)*z[i]-sin(q)*x[i]; x[i]:=x1[i]; z[i]:=z1[i]; {rotate z} x1[i]:=cos(q)*x[i]-sin(q)*y[i]; y1[i]:=sin(q)*x[i]+cos(q)*y[i]; x[i]:=x1[i]; y[i]:=y1[i]; {out sphere} putpixel (round(x[i]*m)+320, round(y[i]*m+sin(yd)*50)+300,15); end; { q:=sin(q1)*0.020; q1:=q1+0.01;} until keypressed end.
автор GM BiT http://www.cyberforum.ru
Комментариев нет:
Отправить комментарий