Home » Personal collection » Acorn hard disk » misc » misc2 » shipw4/RENDER
shipw4/RENDER
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Personal collection » Acorn hard disk » misc » misc2 |
Filename: | shipw4/RENDER |
Read OK: | ✔ |
File size: | 0527 bytes |
Load address: | 0000 |
Exec address: | 0000 |
Duplicates
There is 1 duplicate copy of this file in the archive:
- Personal collection » Acorn ADFS disks » Archimedes » Unlabelled_disk_3.ADF » RENDER
- Personal collection » Acorn hard disk » misc » misc2 » shipw4/RENDER
File contents
10REM Render 20ON ERROR REPORT:PRINT" @ ";ERL:END 30: 40READn,s:DIMp%(n,2),t%(s,2) 50FORr=1TOn:READp%(r,0),p%(r,1),p%(r,2):NEXT 60FORr=1TOs:READt%(r,0),t%(r,1),t%(r,2):NEXT 70MODE15:PROCrender:PRINT"End." 80REPEAT UNTIL FALSE 90: 100DEFPROCrender 110FORz=255TO0STEP-1 120FORpoly=1TOs 130IF p%(t%(poly,0),2)<z AND p%(t%(poly,2),2)>z THEN PROCplot 140NEXT:NEXT 150ENDPROC 160: 170DEFPROCplot 180xmin=p%(t%(poly,0),0)+(z-p%(t%(poly,0),2))*(p%(t%(poly,2),0)-p%(t%(poly,0),0))/(p%(t%(poly,2),2)-p%(t%(poly,0),2)) 190IF z<p%(t%(poly,1),2) THEN xmax=p%(t%(poly,1),0)+(z-p%(t%(poly,1),2))*(p%(t%(poly,2),0)-p%(t%(poly,1),0))/(p%(t%(poly,2),2)-p%(t%(poly,1),2)) 200IF NOT z<p%(t%(poly,1),2) THEN xmax=p%(t%(poly,0),0)+(z-p%(t%(poly,0),2))*(p%(t%(poly,1),0)-p%(t%(poly,0),0))/(p%(t%(poly,1),2)-p%(t%(poly,0),2)) 210ymin=p%(t%(poly,0),1)+(z-p%(t%(poly,0),2))*(p%(t%(poly,2),1)-p%(t%(poly,0),1))/(p%(t%(poly,2),2)-p%(t%(poly,0),2)) 220IF z<p%(t%(poly,1),2) THEN ymax=p%(t%(poly,1),1)+(z-p%(t%(poly,1),2))*(p%(t%(poly,2),1)-p%(t%(poly,1),1))/(p%(t%(poly,2),2)-p%(t%(poly,1),2)) 230IF NOT z<p%(t%(poly,1),2) THEN ymax=p%(t%(poly,0),1)+(z-p%(t%(poly,0),2))*(p%(t%(poly,1),1)-p%(t%(poly,0),1))/(p%(t%(poly,1),2)-p%(t%(poly,0),2)) 240: 250FORx=xmin TO xmax STEP SGN(xmax-xmin) 260y=INT(ymin+(x-xmin)*SGN(xmax-xmin)*(ymax-ymin)/(xmax-xmin)) 270GCOL0,7:POINTx,y 280NEXT 290ENDPROC 300: 310DATA5,2 320: 330DATA640,100,128,100,600,0,100,700,250,800,600,0,800,600,250 340: 350DATA2,1,3,4,1,5
� Render � � �:�" @ ";�:� : (�n,s:�p%(n,2),t%(s,2) 2%�r=1�n:�p%(r,0),p%(r,1),p%(r,2):� <%�r=1�s:�t%(r,0),t%(r,1),t%(r,2):� F�15:�render:�"End." P � � � Z: d��render n�z=255�0�-1 x �poly=1�s �5� p%(t%(poly,0),2)<z � p%(t%(poly,2),2)>z � �plot ��:� �� �: � ��plot �vxmin=p%(t%(poly,0),0)+(z-p%(t%(poly,0),2))*(p%(t%(poly,2),0)-p%(t%(poly,0),0))/(p%(t%(poly,2),2)-p%(t%(poly,0),2)) ��� z<p%(t%(poly,1),2) � xmax=p%(t%(poly,1),0)+(z-p%(t%(poly,1),2))*(p%(t%(poly,2),0)-p%(t%(poly,1),0))/(p%(t%(poly,2),2)-p%(t%(poly,1),2)) ȏ� � z<p%(t%(poly,1),2) � xmax=p%(t%(poly,0),0)+(z-p%(t%(poly,0),2))*(p%(t%(poly,1),0)-p%(t%(poly,0),0))/(p%(t%(poly,1),2)-p%(t%(poly,0),2)) �vymin=p%(t%(poly,0),1)+(z-p%(t%(poly,0),2))*(p%(t%(poly,2),1)-p%(t%(poly,0),1))/(p%(t%(poly,2),2)-p%(t%(poly,0),2)) ܍� z<p%(t%(poly,1),2) � ymax=p%(t%(poly,1),1)+(z-p%(t%(poly,1),2))*(p%(t%(poly,2),1)-p%(t%(poly,1),1))/(p%(t%(poly,2),2)-p%(t%(poly,1),2)) �� � z<p%(t%(poly,1),2) � ymax=p%(t%(poly,0),1)+(z-p%(t%(poly,0),2))*(p%(t%(poly,1),1)-p%(t%(poly,0),1))/(p%(t%(poly,1),2)-p%(t%(poly,0),2)) �: �!�x=xmin � xmax � �(xmax-xmin) ;y=�(ymin+(x-xmin)*�(xmax-xmin)*(ymax-ymin)/(xmax-xmin)) �0,7:Ȓx,y � "� ,: 6�5,2 @: J<�640,100,128,100,600,0,100,700,250,800,600,0,800,600,250 T: ^�2,1,3,4,1,5 �
00000000 0d 00 0a 0c f4 20 52 65 6e 64 65 72 0d 00 14 14 |..... Render....| 00000010 ee 20 85 20 f6 3a f1 22 20 40 20 22 3b 9e 3a e0 |. . .:." @ ";.:.| 00000020 0d 00 1e 05 3a 0d 00 28 19 f3 6e 2c 73 3a de 70 |....:..(..n,s:.p| 00000030 25 28 6e 2c 32 29 2c 74 25 28 73 2c 32 29 0d 00 |%(n,2),t%(s,2)..| 00000040 32 25 e3 72 3d 31 b8 6e 3a f3 70 25 28 72 2c 30 |2%.r=1.n:.p%(r,0| 00000050 29 2c 70 25 28 72 2c 31 29 2c 70 25 28 72 2c 32 |),p%(r,1),p%(r,2| 00000060 29 3a ed 0d 00 3c 25 e3 72 3d 31 b8 73 3a f3 74 |):...<%.r=1.s:.t| 00000070 25 28 72 2c 30 29 2c 74 25 28 72 2c 31 29 2c 74 |%(r,0),t%(r,1),t| 00000080 25 28 72 2c 32 29 3a ed 0d 00 46 17 eb 31 35 3a |%(r,2):...F..15:| 00000090 f2 72 65 6e 64 65 72 3a f1 22 45 6e 64 2e 22 0d |.render:."End.".| 000000a0 00 50 09 f5 20 fd 20 a3 0d 00 5a 05 3a 0d 00 64 |.P.. . ...Z.:..d| 000000b0 0c dd f2 72 65 6e 64 65 72 0d 00 6e 0f e3 7a 3d |...render..n..z=| 000000c0 32 35 35 b8 30 88 2d 31 0d 00 78 0d e3 70 6f 6c |255.0.-1..x..pol| 000000d0 79 3d 31 b8 73 0d 00 82 35 e7 20 70 25 28 74 25 |y=1.s...5. p%(t%| 000000e0 28 70 6f 6c 79 2c 30 29 2c 32 29 3c 7a 20 80 20 |(poly,0),2)<z . | 000000f0 70 25 28 74 25 28 70 6f 6c 79 2c 32 29 2c 32 29 |p%(t%(poly,2),2)| 00000100 3e 7a 20 8c 20 f2 70 6c 6f 74 0d 00 8c 07 ed 3a |>z . .plot.....:| 00000110 ed 0d 00 96 05 e1 0d 00 a0 05 3a 0d 00 aa 0a dd |..........:.....| 00000120 f2 70 6c 6f 74 0d 00 b4 76 78 6d 69 6e 3d 70 25 |.plot...vxmin=p%| 00000130 28 74 25 28 70 6f 6c 79 2c 30 29 2c 30 29 2b 28 |(t%(poly,0),0)+(| 00000140 7a 2d 70 25 28 74 25 28 70 6f 6c 79 2c 30 29 2c |z-p%(t%(poly,0),| 00000150 32 29 29 2a 28 70 25 28 74 25 28 70 6f 6c 79 2c |2))*(p%(t%(poly,| 00000160 32 29 2c 30 29 2d 70 25 28 74 25 28 70 6f 6c 79 |2),0)-p%(t%(poly| 00000170 2c 30 29 2c 30 29 29 2f 28 70 25 28 74 25 28 70 |,0),0))/(p%(t%(p| 00000180 6f 6c 79 2c 32 29 2c 32 29 2d 70 25 28 74 25 28 |oly,2),2)-p%(t%(| 00000190 70 6f 6c 79 2c 30 29 2c 32 29 29 0d 00 be 8d e7 |poly,0),2)).....| 000001a0 20 7a 3c 70 25 28 74 25 28 70 6f 6c 79 2c 31 29 | z<p%(t%(poly,1)| 000001b0 2c 32 29 20 8c 20 78 6d 61 78 3d 70 25 28 74 25 |,2) . xmax=p%(t%| 000001c0 28 70 6f 6c 79 2c 31 29 2c 30 29 2b 28 7a 2d 70 |(poly,1),0)+(z-p| 000001d0 25 28 74 25 28 70 6f 6c 79 2c 31 29 2c 32 29 29 |%(t%(poly,1),2))| 000001e0 2a 28 70 25 28 74 25 28 70 6f 6c 79 2c 32 29 2c |*(p%(t%(poly,2),| 000001f0 30 29 2d 70 25 28 74 25 28 70 6f 6c 79 2c 31 29 |0)-p%(t%(poly,1)| 00000200 2c 30 29 29 2f 28 70 25 28 74 25 28 70 6f 6c 79 |,0))/(p%(t%(poly| 00000210 2c 32 29 2c 32 29 2d 70 25 28 74 25 28 70 6f 6c |,2),2)-p%(t%(pol| 00000220 79 2c 31 29 2c 32 29 29 0d 00 c8 8f e7 20 ac 20 |y,1),2))..... . | 00000230 7a 3c 70 25 28 74 25 28 70 6f 6c 79 2c 31 29 2c |z<p%(t%(poly,1),| 00000240 32 29 20 8c 20 78 6d 61 78 3d 70 25 28 74 25 28 |2) . xmax=p%(t%(| 00000250 70 6f 6c 79 2c 30 29 2c 30 29 2b 28 7a 2d 70 25 |poly,0),0)+(z-p%| 00000260 28 74 25 28 70 6f 6c 79 2c 30 29 2c 32 29 29 2a |(t%(poly,0),2))*| 00000270 28 70 25 28 74 25 28 70 6f 6c 79 2c 31 29 2c 30 |(p%(t%(poly,1),0| 00000280 29 2d 70 25 28 74 25 28 70 6f 6c 79 2c 30 29 2c |)-p%(t%(poly,0),| 00000290 30 29 29 2f 28 70 25 28 74 25 28 70 6f 6c 79 2c |0))/(p%(t%(poly,| 000002a0 31 29 2c 32 29 2d 70 25 28 74 25 28 70 6f 6c 79 |1),2)-p%(t%(poly| 000002b0 2c 30 29 2c 32 29 29 0d 00 d2 76 79 6d 69 6e 3d |,0),2))...vymin=| 000002c0 70 25 28 74 25 28 70 6f 6c 79 2c 30 29 2c 31 29 |p%(t%(poly,0),1)| 000002d0 2b 28 7a 2d 70 25 28 74 25 28 70 6f 6c 79 2c 30 |+(z-p%(t%(poly,0| 000002e0 29 2c 32 29 29 2a 28 70 25 28 74 25 28 70 6f 6c |),2))*(p%(t%(pol| 000002f0 79 2c 32 29 2c 31 29 2d 70 25 28 74 25 28 70 6f |y,2),1)-p%(t%(po| 00000300 6c 79 2c 30 29 2c 31 29 29 2f 28 70 25 28 74 25 |ly,0),1))/(p%(t%| 00000310 28 70 6f 6c 79 2c 32 29 2c 32 29 2d 70 25 28 74 |(poly,2),2)-p%(t| 00000320 25 28 70 6f 6c 79 2c 30 29 2c 32 29 29 0d 00 dc |%(poly,0),2))...| 00000330 8d e7 20 7a 3c 70 25 28 74 25 28 70 6f 6c 79 2c |.. z<p%(t%(poly,| 00000340 31 29 2c 32 29 20 8c 20 79 6d 61 78 3d 70 25 28 |1),2) . ymax=p%(| 00000350 74 25 28 70 6f 6c 79 2c 31 29 2c 31 29 2b 28 7a |t%(poly,1),1)+(z| 00000360 2d 70 25 28 74 25 28 70 6f 6c 79 2c 31 29 2c 32 |-p%(t%(poly,1),2| 00000370 29 29 2a 28 70 25 28 74 25 28 70 6f 6c 79 2c 32 |))*(p%(t%(poly,2| 00000380 29 2c 31 29 2d 70 25 28 74 25 28 70 6f 6c 79 2c |),1)-p%(t%(poly,| 00000390 31 29 2c 31 29 29 2f 28 70 25 28 74 25 28 70 6f |1),1))/(p%(t%(po| 000003a0 6c 79 2c 32 29 2c 32 29 2d 70 25 28 74 25 28 70 |ly,2),2)-p%(t%(p| 000003b0 6f 6c 79 2c 31 29 2c 32 29 29 0d 00 e6 8f e7 20 |oly,1),2))..... | 000003c0 ac 20 7a 3c 70 25 28 74 25 28 70 6f 6c 79 2c 31 |. z<p%(t%(poly,1| 000003d0 29 2c 32 29 20 8c 20 79 6d 61 78 3d 70 25 28 74 |),2) . ymax=p%(t| 000003e0 25 28 70 6f 6c 79 2c 30 29 2c 31 29 2b 28 7a 2d |%(poly,0),1)+(z-| 000003f0 70 25 28 74 25 28 70 6f 6c 79 2c 30 29 2c 32 29 |p%(t%(poly,0),2)| 00000400 29 2a 28 70 25 28 74 25 28 70 6f 6c 79 2c 31 29 |)*(p%(t%(poly,1)| 00000410 2c 31 29 2d 70 25 28 74 25 28 70 6f 6c 79 2c 30 |,1)-p%(t%(poly,0| 00000420 29 2c 31 29 29 2f 28 70 25 28 74 25 28 70 6f 6c |),1))/(p%(t%(pol| 00000430 79 2c 31 29 2c 32 29 2d 70 25 28 74 25 28 70 6f |y,1),2)-p%(t%(po| 00000440 6c 79 2c 30 29 2c 32 29 29 0d 00 f0 05 3a 0d 00 |ly,0),2))....:..| 00000450 fa 21 e3 78 3d 78 6d 69 6e 20 b8 20 78 6d 61 78 |.!.x=xmin . xmax| 00000460 20 88 20 b4 28 78 6d 61 78 2d 78 6d 69 6e 29 0d | . .(xmax-xmin).| 00000470 01 04 3b 79 3d a8 28 79 6d 69 6e 2b 28 78 2d 78 |..;y=.(ymin+(x-x| 00000480 6d 69 6e 29 2a b4 28 78 6d 61 78 2d 78 6d 69 6e |min)*.(xmax-xmin| 00000490 29 2a 28 79 6d 61 78 2d 79 6d 69 6e 29 2f 28 78 |)*(ymax-ymin)/(x| 000004a0 6d 61 78 2d 78 6d 69 6e 29 29 0d 01 0e 0e e6 30 |max-xmin)).....0| 000004b0 2c 37 3a c8 92 78 2c 79 0d 01 18 05 ed 0d 01 22 |,7:..x,y......."| 000004c0 05 e1 0d 01 2c 05 3a 0d 01 36 08 dc 35 2c 32 0d |....,.:..6..5,2.| 000004d0 01 40 05 3a 0d 01 4a 3c dc 36 34 30 2c 31 30 30 |.@.:..J<.640,100| 000004e0 2c 31 32 38 2c 31 30 30 2c 36 30 30 2c 30 2c 31 |,128,100,600,0,1| 000004f0 30 30 2c 37 30 30 2c 32 35 30 2c 38 30 30 2c 36 |00,700,250,800,6| 00000500 30 30 2c 30 2c 38 30 30 2c 36 30 30 2c 32 35 30 |00,0,800,600,250| 00000510 0d 01 54 05 3a 0d 01 5e 10 dc 32 2c 31 2c 33 2c |..T.:..^..2,1,3,| 00000520 34 2c 31 2c 35 0d ff |4,1,5..| 00000527