home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMIGA PD 1
/
AMIGA-PD-1.iso
/
Programme_zum_Heft
/
Programmieren
/
Kurztests
/
ACE
/
Prgs
/
Gfx
/
shuttle.b
< prev
next >
Wrap
Text File
|
1994-09-12
|
4KB
|
136 lines
' Written by an unknown Author
' Changed a bit by M.Zielinski@amtrash.comlink.de
' and by David Benn
WINDOW 1, "Shuttle", (0,0)-(631,186), 0
X=0:Y=0:Z=0:X3=0:Y3=0:Z3=0:AM=0:BM=0:CM=0:DM=0
EM=0:FM=0:GM=0:HM=0:IM=0:D=0:P=0:B=0:H=0:U=0:U1=0:V1=0:V=0
DIM VV(300,3),EE(300)
COLOR 1, 2: CLS
READ NV
FOR P=1 TO NV
READ VV(P,1)
READ VV(P,2)
READ VV(P,3)
VV(P,1) = .12 * VV(P,1)
VV(P,2) = .12 * VV(P,2)
VV(P,3) = .12 * VV(P,3)
NEXT P
READ NE
FOR E=1 TO NE
READ EE(E)
NEXT E
D=120
Anfang:
CLS : PRINT "Enter three angles:"
INPUT "x: ",P0
INPUT "y: ",P1
INPUT "z: ",P2
CLS : pi = 3.1416
P= (2*pi) * P0 / 255 - pi
B= (2*pi) * P2 / 255
H= (2*pi) * P1 / 255
GOSUB 390
XV = -D * CP * SH: REM ---SEE SUB.---
YV = -D * CP * CH
ZV = -D * SP
' --- PROJECT POINTS---
FOR E=1 TO NE
X = VV( ABS( EE ( E ) ), 1 )
Y = VV( ABS( EE ( E ) ), 2 )
Z = VV( ABS( EE ( E ) ), 3 )
GOSUB 520
IF EE(E)>0 THEN LINE( U1*2+75,V1+20 )-( U*2+75,V+20 )
U1 = U: V1 = V
NEXT E
LOCATE 1,1:PRINT "Hit 'C' to continue or 'Q' to quit."
k$="":WHILE k$<>"C" and k$<>"Q":k$=UCASE$(INKEY$):SLEEP:WEND
IF k$="Q" THEN goto ende
GOTO Anfang
390:
CH = COS(H): SH = SIN(H)
CP = COS(P): SP = SIN(P)
CB = COS(B): SB = SIN(B)
AM = CB * CH - SH * SP * SB
BM = -CB * SH - SP * CH * SB
CM = CP * SB
DM = SH * CP
EM = CP * CH
FM = SP
GM = -CH * SB - SH * SP * CB
HM = SH * SB - SP * CH * CB
IM = CP * CB
RETURN
520:
X = X - XV
Y = Y - YV
Z = Z - ZV
X3 = AM * X + BM * Y + CM * Z
Y3 = DM * X + EM * Y + FM * Z
Z3 = GM * X + HM * Y + IM * Z
U = 135 + 13.5 * D * X3 / Y3
V = 80 - 11.5 * D * Z3 / Y3
RETURN
DATA 124
DATA 0,-2.2,46,1.5,-2.6,46,2.2,-4.6,46,1.7,-6.5,46,0,-6.7,46
DATA -1.7,-6.5,46,-2.2,-4.6,46,-1.5,-2.6,46
DATA 0,-.8,43,2.8,-1.5,43,4,-4.5,43,3,-7.2,43,0,-8,43,-3,-7.2,43
DATA -4,-4.5,43,-2.8,-1.5,43
DATA 0,1.7,38,4.6,0,38,5.8,-4.4,38,4,-8.2,38,0,-9,38,-4,-8.2,38
DATA -5.8,-4.4,38,-4.6,0,38
DATA 0,4,32.5,4.5,1,32.5,5.8,-4.6,32.5,4,-9,32.5,0,-9.5,32.5,-4,-9,32.5
DATA -5.8,-4.6,32.5,-4.5,1,32.5
DATA 0,8,26.3,3.5,7,26.3,7.8,2,26.3,8,-7,26.3,0,-9.8,26.3,-8,-7,26.3
DATA -7.8,2,26.3,-3.5,7,26.3
DATA 0,8,21.5,3.8,7.5,21.5,8,3,21.5,8,-8,21.5,0,-9.8,21.5,-8,-8,21.5
DATA -8,3,21.5,-3.8,7.5,21.5
DATA 0,8,14,4.7,7,14,8,4,14,8,-8.7,14,0,-10,14,-8,-8.7,14,-8,4,14
DATA -4.7,7,14
DATA 0,8,4,4.7,7,4,8,4,4,8,-8.7,4,0,-10,4,-8,-8.7,4,-8,4,4
DATA -4.7,7,4
DATA 0,8,-12,4.7,7,-12,8,4,-12,8,-8.7,-12,0,-10,-12,-8,-8.7,-12,-8,4,-12
DATA -4.7,7,-12
DATA 0,8,-27.3,4.7,7,-27.3,8,4,-27.3,8,-8.7,-27.3,0,-10,-27.3,-8,-8.7,-27.3
DATA -8,4,-27.3,-4.7,7,-27.3
DATA 0,8,-35.6,4.7,7,-35.6,8,4,-35.6,8,-8.7,-35.6,0,-10,-35.6,-8,-8.7,-35.6
DATA -8,4,-35.6,-4.7,7,-35.6
DATA 0,9,-43,2,8.5,-43,8.8,1.5,-43,9,-10,-43,0,-10.8,-43,-9,-10,-43
DATA -8.8,1.5,-43,-2,8.5,-43
DATA 0,9.5,-48,2,9.3,-48,9.2,1.5,-48,10,-10,-48,0,-10.2,-48,-10,-10,-48
DATA -9.2,1.5,-48,-2,9.3,-48
DATA 8.7,-8.7,21,15,-8.7,-16,35,-10,-36,35,-10,-40
DATA -8.7,-8.7,21,-15,-8.7,-16,-35,-10,-36,-35,-10,-40
DATA 0,13,-37,0,33,-60,0,33,-69,0,14,-60
DATA 6,11,-43,6,11,-48,11,5,-43,11,5,-48,-6,11,-43,-6,11,-48,-11,5,-43
DATA -11,5,-48
DATA 259
DATA -1,2,3,4,5,6,7,8,1,-9,10,11,12,13,14,15,16,9,-17,18,19,20,21,22,23,24,17
DATA -25,26,27,28,29,30,31,32,25,-33,34,35,36,37,38,39,40,33
DATA -41,42,43,44,45,46,47,48,41,-49,50,51,52,53,54,55,56,49
DATA -57,58,59,60,61,62,63,64,57,-65,66,67,68,69,70,71,72,65
DATA -73,74,75,76,77,78,79,80,73,-81,82,83,84,85,86,87,88,81
DATA -89,90,91,92,93,94,95,96,89,-97,98,99,100,101,102,103,104,97
DATA -1,9,17,25,33,41,49,57,65,73,81,89,97
DATA -2,10,18,26,34,42,50,58,66,74,82,90,98
DATA -3,11,19,27,35,43,51,59,67,75,83,91,99
DATA -4,12,20,28,36,44,52,60,68,76,84,92,100
DATA -5,13,21,29,37,45,53,61,69,77,85,93,101
DATA -6,14,22,30,38,46,54,62,70,78,86,94,102
DATA -7,15,23,31,39,47,55,63,71,79,87,95,103
DATA -8,16,24,32,40,48,56,64,72,80,88,96,104
DATA -44,105,106,107,108,92
DATA -46,109,110,111,112,94
DATA -81,113,114,115,116,89
DATA -82,117,118,-83,119,120
DATA -87,121,122,-88,123,124
DATA -117,119,-121,123,-118,120,-122,124
ENDE:
WINDOW CLOSE 1
END