|
|
Line 22: |
Line 22: |
| During coding of Classic Elite 'dry-dock' code was used to view some of the ships during development (referred to as *VIEW on [http://www.iancgbell.clara.net/elite/text/index.htm Ian Bell's] web site). A movie for the Asp Mk. II generated using *VIEW run under the BBC emulator BeebEm3 is available [http://www.box.net/shared/4dmj7v641p here]. | | During coding of Classic Elite 'dry-dock' code was used to view some of the ships during development (referred to as *VIEW on [http://www.iancgbell.clara.net/elite/text/index.htm Ian Bell's] web site). A movie for the Asp Mk. II generated using *VIEW run under the BBC emulator BeebEm3 is available [http://www.box.net/shared/4dmj7v641p here]. |
| | | |
− | The BBC Basic listing program (from Ian Bell's) website that generated the ship data for the Asp Mk II
| |
| | | |
− | <tt>
| |
− | 5 REM - - - A S P - - -
| |
− | 7 MODE 3
| |
− | 10 Q%=2
| |
− | 15 F%=2^Q%
| |
− | 20 B%=&6000 \ arrive here from line 255 if power 2 given
| |
− | 40 DPT=&18
| |
− | 50 MAXLI=25
| |
− | 60 P1=22:P2=31:P3=3:P5=8
| |
− | 70 GUN=8
| |
− | 120 GOSUB 1000
| |
− | 140 GOSUB 2000
| |
− | 200 PRINT'" Nodes "
| |
− | 210 FOR I%=0 TO N%:
| |
− | PRINT I%,FNR(V(I%,0)),FNR(V(I%,1)),FNR(V(I%,2)):
| |
− | NEXT
| |
− | 211 PRINT 2*A*S1" "2*A*S2
| |
− | 212 REM FOR I%=0 TO N%: FOR J%=I% TO N%:
| |
− | REM PRINT I%,J%,,FNR(SQR((V(I%,0)-V(J%,0))^2+(V(I%,1)-V(J%,1))^2+(V(I%,2)-V(J%,2))^2)):
| |
− | REM NEXT,
| |
− | 230 PRINT'" Normals * 2^";Q%'
| |
− | 240 FOR I%=0 TO M%:
| |
− | PRINT I%,FNR(U(I%,0)),FNR(U(I%,1)),FNR(U(I%,2)):
| |
− | NEXT
| |
− | 250 INPUT'"Power of two? "A$:
| |
− | IF A$<>"": Q%=VALA$: CLEAR: F%=2^Q%: PRINT'': GOTO 20
| |
− | 260 MODE1
| |
− |
| |
− | 300 REM Pack Nodes
| |
− | 310 RESTORE 5000
| |
− | 320 W%=20
| |
− | 330 DIM W%(N%,3)
| |
− |
| |
− | 340 FOR I%= 0 TO N%:
| |
− | PROCC(V(I%,0),V(I%,1),V(I%,2),31):
| |
− | PROCB(A0):PROCB(A1):PROCB(A2):PROCB(A3)
| |
− | 350 READ A0,A1,A2,A3
| |
− | 370 PROCB(16*A0+A1):PROCB(16*A2+A3)
| |
− | 372 W%(I%,0)=A0:
| |
− | W%(I%,1)=A1:
| |
− | W%(I%,2)=A2:
| |
− | W%(I%,3)=A3
| |
− | 380 NEXT
| |
− |
| |
− | 400 REM Pack Node Walk
| |
− | 410 RESTORE 6000
| |
− | 414 P=18
| |
− | 420 B%?3 = W% MOD256:
| |
− | B%?16 = W% DIV256
| |
− | 430 READ L%
| |
− | 440 FOR I%=1 TO L%:
| |
− | READ P,B0,B1
| |
− | 442 C%=0:
| |
− | A0=FNMATCH(B0,B1):
| |
− | C%=C%+1:
| |
− | A1=FNMATCH(B0,B1)
| |
− | 450 PROCB(P):PROCB(16*A0+A1):PROCB(4*B0):PROCB(4*B1)
| |
− | 460 NEXT \ line 440
| |
− |
| |
− | 500 REM Pack Normals
| |
− | 520 B%?4 =W% MOD256:B%?17 =W% DIV256
| |
− | 540 FOR I%=0 TO M%:
| |
− | PROCC(U(I%,0),U(I%,1),U(I%,2),31):
| |
− | PROCB(A3):PROCB(A0):PROCB(A1):PROCB(A2):
| |
− | NEXT
| |
− | 570 B%?6=4*GUN:
| |
− | B%?8=6*N%+6:
| |
− | B%?9=L%:
| |
− | B%?12=M%*4+4:
| |
− | B%?18=Q%:
| |
− | B%?5=4*MAXLI+1:
| |
− | B%?13=DPT
| |
− | 580 OSCLI("S.ASP "+STR$~B%+" "+STR$~(B%+W%)): \ save file with info
| |
− | PRINT~W%
| |
− | 600 END
| |
− |
| |
− | 900 DEFPROCN(I%,I,J,K)
| |
− | 910 U0=V(J,0)-V(I,0):U1=V(J,1)-V(I,1):U2=V(J,2)-V(I,2)
| |
− | 920 V0=V(K,0)-V(I,0):V1=V(K,1)-V(I,1):V2=V(K,2)-V(I,2)
| |
− | 930 W0=U1*V2-U2*V1:
| |
− | W1=U2*V0-U0*V2: \ w is vector cross of: u x v
| |
− | W2=U0*V1-U1*V0
| |
− | 940 S=SQR(W0*W0+W1*W1+W2*W2):
| |
− | W0=W0/S:W1=W1/S:W2=W2/S \ normalsize
| |
− | 950 R=W0*V(I,0)+W1*V(I,1)+W2*V(I,2):
| |
− | W0=R*F%*W0:W1=R*F%*W1:W2=R*F%*W2
| |
− | 960 U(I%,0)=W0:U(I%,1)=W1:U(I%,2)=W2
| |
− | 990 ENDPROC
| |
− |
| |
− | 1000 REM NODES -Put coords into V(,)
| |
− | 1005 REM No. is...
| |
− | 1010 N%=18
| |
− | 1050 DIM V(N%,2),P(2)
| |
− | 1060 A=45:WF=.3
| |
− | 1070 S1=SIN(PI/5):
| |
− | S2=SIN(2*PI/5):
| |
− | C1=COS(PI/5):
| |
− | C2=COS(2*PI/5)
| |
− | 1080 CA=((S2/S1)-1)/2/S1:
| |
− | D=ACS(CA):
| |
− | SA=SIN(D)
| |
− | 1090 H1=2*A*S1*SA:
| |
− | A1=A*S2/S1
| |
− | 1092 CB=((S2/S1)-C1)/(1+C1):
| |
− | SB=SIN(ACS(CB)):
| |
− | H2=A*(1+C1)*SB
| |
− | 1100 V(0,1)=-A1
| |
− | 1110 V(1,1)=-A:
| |
− | V(1,2)=-H1
| |
− | 1120 PROCROT(3,0,2*PI/5)
| |
− | 1130 PROCROT(2,1,2*PI/5)
| |
− | 1140 PROCROT(4,0,PI/5):
| |
− | V(4,2)=H2-H1
| |
− | 1150 PROCROT(8,1,PI/5):
| |
− | V(8,2)=H2
| |
− | 1160 PROCNX(5,2)
| |
− | 1170 PROCNX(6,3)
| |
− | 1180 PROCNX(7,4)
| |
− | 1190 PROCNX(9,8)
| |
− | 1200 CY=V(2,1):
| |
− |
| |
− | FOR I%= 0TO 9:
| |
− | V(I%,1)=V(I%,1)-CY:
| |
− | NEXT
| |
− | 1210 PROCNY(12,1)
| |
− | 1220 PROCNY(10,4)
| |
− | 1230 PROCNY(11,7)
| |
− |
| |
− | 1300 FOR I%=0 TO N%:
| |
− | V(I%,1)=V(I%,1)*WF:
| |
− | NEXT
| |
− | 1320 PROCDET(13,5,1,12,.3,.3)
| |
− | 1330 PROCDET(14,5,1,12,.3,.55)
| |
− | 1340 PROCNY(15,14)
| |
− | 1350 PROCNX(16,13)
| |
− | 1360 PROCNX(17,14)
| |
− | 1370 PROCNX(18,15)
| |
− | 1400 RETURN
| |
− |
| |
− | 1700 DEFPROCDET(R%,S%,T%,U%,M,N):
| |
− | LOCALI%
| |
− | 1710 FOR I%=0 TO 2:
| |
− | V(R%,I%)=V(S%,I%)+M*(V(T%,I%)-V(S%,I%))+N*(V(U%,I%)-V(S%,I%)):
| |
− | NEXT
| |
− | 1720 ENDPROC
| |
− |
| |
− | 1800 DEF PROCNX(I%,J%):
| |
− | V(I%,0)=-V(J%,0):
| |
− | V(I%,1)=V(J%,1):
| |
− | V(I%,2)=V(J%,2):
| |
− | ENDPROC
| |
− |
| |
− | 1850 DEF PROCNY(I%,J%):
| |
− | V(I%,1)=-V(J%,1):
| |
− | V(I%,2)=V(J%,2):
| |
− | V(I%,0)=V(J%,0):
| |
− | ENDPROC
| |
− |
| |
− | 1900 DEF PROCROT(I%,J%,B):
| |
− | V(I%,0)=V(J%,0)*COS(B)-V(J%,1)*SIN(B):
| |
− | V(I%,1)=V(J%,1)*COS(B)+V(J%,0)*SIN(B):
| |
− | V(I%,2)=V(J%,2):
| |
− | ENDPROC
| |
− |
| |
− | 2000 REM NORMALS - Put into U(,)
| |
− | 2004 REM No. is...
| |
− | 2005 M%=11
| |
− | 2010 DIM U(M%,2)
| |
− | 2015 RESTORE 3000
| |
− | 2020 FOR I%=0 TO M%:
| |
− | READ I,J,K:
| |
− | PROCN(I%,I,J,K):
| |
− | NEXT
| |
− | 2090 RETURN
| |
− | 2099 REM Three Nodes for each Normal \ triangles
| |
− | 3000 DATA 0,8,9
| |
− | 3010 DATA 0,2,3
| |
− | 3020 DATA 0,5,6
| |
− | 3030 DATA 10,11,12
| |
− | 3040 DATA 8,9,10
| |
− | 3050 DATA 5,6,12
| |
− | 3060 DATA 2,3,12
| |
− | 3070 DATA 3,4,8
| |
− | 3080 DATA 6,7,9
| |
− | 3090 DATA 3,8,10
| |
− | 3100 DATA 6,9,11
| |
− | 3110 DATA 1,2,5
| |
− |
| |
− | 4990 REM Four Normals associated to each node \ cross
| |
− | 5000 DATA 0,1,2,2 \ look at this data first
| |
− | 5010 DATA 1,2,11,11
| |
− | 5020 DATA 1,6,11,11
| |
− | 5030 DATA 1,6,7,9
| |
− | 5040 DATA 0,1,7,7
| |
− | 5050 DATA 2,5,11,11
| |
− | 5060 DATA 2,5,8,10
| |
− | 5070 DATA 0,2,8,8
| |
− | 5080 DATA 0,4,7,9
| |
− | 5090 DATA 0,4,8,10
| |
− | 5100 DATA 3,4,6,9
| |
− | 5110 DATA 3,4,5,10
| |
− | 5120 DATA 3,5,6,11
| |
− | 5130 DATA 11,11,11,11
| |
− | 5140 DATA 11,11,11,11
| |
− | 5150 DATA 11,11,11,11
| |
− | 5160 DATA 11,11,11,11
| |
− | 5170 DATA 11,11,11,11
| |
− | 5180 DATA 11,11,11,11
| |
− |
| |
− | 6000 REM NODE WALK
| |
− | 6005 REM No. Lines is...
| |
− | 6008 DATA 29
| |
− | 6009 REM Pr No1 No2
| |
− | 6010 DATA P1, 0,1
| |
− | 6020 DATA P1, 0,4
| |
− | 6030 DATA P1, 0,7
| |
− | 6040 DATA 31, 1,2
| |
− | 6050 DATA 31, 2,3
| |
− | 6060 DATA P5, 3,8
| |
− | 6070 DATA 31, 8,9
| |
− | 6080 DATA P5,6,9
| |
− | 6090 DATA 31,5,6
| |
− | 6100 DATA 31,1,5
| |
− | 6110 DATA P2,3,4
| |
− | 6120 DATA P2,4,8
| |
− | 6130 DATA P2,6,7
| |
− | 6140 DATA P2,7,9
| |
− | 6150 DATA 31,2,12
| |
− | 6160 DATA 31,5,12
| |
− | 6170 DATA P1,10,12
| |
− | 6180 DATA P1,11,12
| |
− | 6190 DATA P1,10,11
| |
− | 6200 DATA P2,6,11
| |
− | 6210 DATA P2,9,11
| |
− | 6220 DATA P2,3,10
| |
− | 6230 DATA P2,8,10
| |
− | 6240 DATA P3,13,14
| |
− | 6250 DATA P3,14,15
| |
− | 6260 DATA P3,15,13
| |
− | 6270 DATA P3,16,17
| |
− | 6280 DATA P3,17,18
| |
− | 6290 DATA P3,18,16
| |
− |
| |
− | 7000 DEF FNMATCH(J%,K%)
| |
− | 7010 IF W%(J%,C%)=W%(K%,0) THEN =W%(K%,0)
| |
− | 7020 IF W%(J%,C%)=W%(K%,1) THEN =W%(K%,1)
| |
− | 7030 IF W%(J%,C%)=W%(K%,2) THEN =W%(K%,2)
| |
− | 7040 IF W%(J%,C%)=W%(K%,3) THEN =W%(K%,3)
| |
− | 7050 C%=C%+1:
| |
− | GOTO 7010
| |
− |
| |
− | 10000 DEF FNR(X)=" "+STR$(INT(X+.5))
| |
− |
| |
− | 11000 DEF PROCB(X):
| |
− | W%?B%=INT(X+.5):
| |
− | W%=W%+1:
| |
− | ENDPROC
| |
− |
| |
− | 12000 DEF PROCC(X0,X1,X2,X3):
| |
− | A0=INT(X0+.5):
| |
− | A1=INT(X1+.5):
| |
− | A2=INT(X2+.5)
| |
− | 12010 A3=X3:
| |
− | IF A0<0 A3=A3 OR 128:A0=-A0
| |
− | 12020 IF A1<0 A3=A3 OR 64:A1=-A1
| |
− | 12030 IF A2<0 A3=A3 OR 32:A2=-A2
| |
− | 12040 ENDPROC
| |
− | <\tt>
| |
| [[Category:Classic]] | | [[Category:Classic]] |