This month's Visuals contribution is a program which will spin a piece of text on screen about a central point. The text is generated by the program itself using its own data, and the spinning effect uses 3D drawing techniques which include the use of perspective. Even though the letters are drawn relatively crudely (in order to keep the data statements to a minimum), the spinning effect works well.
When you run the program it asks for a message. This may be up to ten characters in length (though best effects are obtained with less), and these must be in upper case. After a short pause, the message will appear, and will spin around a central point, with a continually varying plane of rotation.
If you would like to try out the program without typing in all the data, enter all lines up to 930, and when prompted for text, enter hashes (#) or exclamation marks (!). Additionally, the program may be customised a little by experimenting with the text size (size%), perspective (per%) and depth (depth%) in line 80.
10 REM >Rotate
20 REM Program Text Rotation
30 REM Version A 0.6
40 REM Author James Bonfield
50 REM RISC User May 1989
60 REM Program Subject to Copyright
70 :
80 size%=15:depth%=50:per%=2
90 MODE 0:OFF
100 ON ERROR MODE 0:REPORT:PRINT" at line ";ERL:END
110 PROCstartdata
120 PROCdotext
130 REPEAT
140 PROCdisplay
150 UNTIL FALSE
160 :
170 DEFPROCstartdata
180 ORIGIN 640,512
190 theta=PI/50:psi=PI/80:alpha=PI/30
200 SA=SIN(theta):CA=COS(theta)
210 SB=SIN(alpha):CB=COS(alpha)
220 SC=SIN(psi):CC=COS(psi)
230 XX=CB*CC:XY=CC*SA*SB-SC*CA
240 XZ=CA*SB*CC+SA*SC
250 YX=CB*SC:YY=SA*SB*SC+CA*CC
260 YZ=CA*SB*SC-SA*CC
270 ZX=-SB:ZY=SA*CB:ZZ=CA*CB
280 TY=0:TX=0:bank%=1
290 ENDPROC
300 :
310 DEFPROCdotext
320 INPUT "Please enter message : "M$
330 PRINT"Please wait"
340 number_of_points=0
350 FOR I%=1 TO LEN(M$)
360 PROCrestore_data
370 READ S
380 number_of_points+=S
390 NEXT
400 DIM points(number_of_points,4)
410 S1=1
420 FOR I%=1 TO LEN(M$)
430 PROCrestore_data
440 READ S
450 FOR N=1 TO S
460 READ points(S1,1),points(S1,2),points(S1,4)
470 points(S1,1)=points(S1,1)+(I%-LEN(M$)/2)*10-7
480 points(S1,2)=points(S1,2)-4:S1=S1+1
490 NEXT
500 NEXT
510 ENDPROC
520 :
530 DEFPROCdisplay
540 A=0:X=points(0,1):Y=points(0,2)
550 Z=points(0,3)
560 PROCperspective
570 OX%=XS%:OY%=YS%
580 SYS 6,112,bank%
590 bank%=bank% EOR 3:SYS 6,113,bank%
600 WAIT:CLS
610 FOR A=1 TO number_of_points
620 X=points(A,1)
630 Y=points(A,2)
640 Z=points(A,3)
650 PROCperspective
660 IF points(A,4)<>0 THEN LINE OX%,OY%,XS%,YS%
670 OX%=XS%:OY%=YS%
680 NEXT
690 S-=(S<12)/5
700 ENDPROC
710 :
720 DEFPROCperspective
730 XT=X*XX+Y*XY+Z*XZ
740 YT=X*YX+Y*YY+Z*YZ
750 ZT=X*ZX+Y*ZY+Z*ZZ
760 points(A,1)=XT:points(A,2)=YT
770 points(A,3)=ZT
780 XS%=size%*XT*depth%/(ZT+per%+depth%)
790 YS%=size%*YT*depth%/(ZT+per%+depth%)
800 ENDPROC
810 :
820 DEFPROCrestore_data
830 RESTORE
840 REPEAT
850 READ a%
860 UNTIL a%=ASC(MID$(M$,I%,1))
870 ENDPROC
880 :
890 DATA 31,1,0,0,0
900 DATA 32,1,0,0,0
910 DATA 33,4,3,0,0,3,1,1,3,4,0,3,8,1
920 DATA 34,4,2,5,0,2,8,1,4,5,0,4,8,1
930 DATA 35,8,2,0,0,2,8,1,4,0,0,4,8,1,0,3,0,6,3,1,0,5,0,6,5,1
940 DATA 36,8,0,1,0,6,1,1,6,4,1,0,4,1,0,7,1,6,7,1,3,0,0,3,8,1
950 DATA 37,6,0,0,0,6,8,1,6,1,0,5,2,1,1,6,0,0,7,1
960 DATA 38,7,6,0,0,0,5,1,2,8,1,4,5,1,0,2,1,2,0,1,6,3,1
970 DATA 39,4,2,5,0,3,6,1,3,7,1,2,7,1
980 DATA 40,4,3,0,0,2,2,1,2,6,1,3,8,1
990 DATA 41,4,3,0,0,4,2,1,4,6,1,3,8,1
1000 DATA 42,8,0,0,0,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