home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / vrac / vester_e.zip / 3D.BAS next >
BASIC Source File  |  1994-08-08  |  13KB  |  215 lines

  1. 10 CLEAR,32768!:KEY OFF:CLS
  2. 15 GOTO 2000
  3. 20 X$="system"+CHR$(13):KEY 10,X$
  4. 25 X$="files":KEY 9,X$
  5. 30 DEF SEG=&H5F00
  6. 40 BLOAD "label.asm",&H100
  7. 50 POKE &H1B0,0:POKE &H1DB,80:POKE &H1DC,8:POKE &H1E6,235:POKE &H1E7,18:POKE &H1A7,80:POKE &H241,80:POKE &H24C,80:POKE &H24D,8
  8. 60 POKE &H1BE,191:POKE &H1BF,80:POKE &H1C0,8:POKE &H1C1,235:POKE &H1C2,3:POKE &H1FA,185:POKE &H1FD,243:POKE &H1FE,164
  9. 70 POKE &H1FF,235:POKE &H200,63:POKE &H180,60:POKE &H1A0,235:POKE &H1A1,9
  10. 80 PRINT:PRINT:PRINT:PRINT:PRINT"                  THREE DIMENSION PIX FILES"
  11. 90 PRINT:PRINT"   This program creates 3D files for the K3BC SSTV system. It assumes you"
  12. 100 PRINT"have a camcorder or TV camera and a frame grabber to get the two image files"
  13. 110 PRINT"required to get true 3D rendition. It is not a synthetic 3D generator. The"
  14. 120 PRINT"two images used are typically seen as a RIGHT EYE image and a LEFT EYE image,"
  15. 130 PRINT"and are just what the camera sees when two frames of the same scene are taken"
  16. 140 PRINT"with the camera moved a distance equal to the space between your eyes. Now"
  17. 150 PRINT"if you view the scene by opening and closing alternate eyes, you can get an"
  18. 160 PRINT"idea how much an object in the foreground shifts. When you shift the camera"
  19. 170 PRINT"location now you can adjust its pointing angle to give about the same shift"
  20. 180 PRINT"as observed. If viewing thru the frame grabber, it will be typically just a"
  21. 190 PRINT"few pixels. You can synthetically put anything (call signs, other images, etc."
  22. 195 PRINT"that can be added by the LABEL programs) at any depth in the image by writing"
  23. 196 PRINT"them on the RIGHT and LEFT file images with offsets that are a few pixels"
  24. 197 PRINT"apart. More offset moves it closer. Likewise, you can use a single file image"
  25. 198 PRINT"as both RIGHT and LEFT and make the LABEL additions appear at different depths"
  26. 199 PRINT"by differing offsets. Experiment to get what you like. Put your call sign"
  27. 200 PRINT"in a clear area. When capturing 3D frames with your camcorder off location"
  28. 201 PRINT"remember to say 'right' and 'left' into the mike."
  29. 220 PRINT"   All filenames below will have their suffix added by the program."
  30. 230 PRINT:INPUT"    Path and Filename of RIGHT EYE pix file (Default=d:RIGHT)";B$
  31. 235 IF B$="" THEN B$=DR$+":right"
  32. 270 PRINT:PRINT:INPUT"    Path and Filename of LEFT EYE pix file (Default=d:LEFT)";A$
  33. 275 IF A$="" THEN A$=DR$+":left"
  34. 280 PRINT:PRINT:PRINT"    What mode is pix file ? (3)Scottie 1 (4)Scottie 2 (5)AVT90 (6)AVT94"
  35. 290 INPUT"(7)Martin 1 (77)Martin 2 (8)Wraase 96 (96)ColorFAX";I
  36. 300 IF I=0 GOTO 280
  37. 390 C$="hello.ben"
  38. 410 IF I=3 THEN A$=A$+".s1":JL=878:GOTO 490
  39. 420 IF I=4 THEN A$=A$+".s2":JL=568:GOTO 490
  40. 430 IF I=5 THEN A$=A$+".90":JL=768:GOTO 490
  41. 440 IF I=6 THEN A$=A$+".94":JL=960:GOTO 490
  42. 450 IF I=7 THEN A$=A$+".m1":JL=915:GOTO 490
  43. 455 IF I=77 THEN A$=A$+".m2":JL=464:GOTO 490
  44. 460 IF I=8 THEN A$=A$+".96":JL=745:GOTO 490
  45. 471 IF I=96 THEN A$=A$+".cfx":JL=1638:GOTO 490
  46. 480 GOTO 280
  47. 490 PRINT:PRINT:INPUT"    Path and Filename for Output file";D$
  48. 500 IF I=3 THEN B$=B$+".s1":D$=D$+".s1":LL=878:L=288:L%=256
  49. 510 IF I=4 THEN B$=B$+".s2":D$=D$+".s2":LL=568:L=184:L%=256
  50. 520 IF I=5 THEN B$=B$+".90":D$=D$+".90":LL=768:L=256:L%=240
  51. 530 IF I=6 THEN B$=B$+".94":D$=D$+".94":LL=960:L=320:L%=200
  52. 540 IF I=7 THEN B$=B$+".m1":D$=D$+".m1":LL=915:L=302:L%=256
  53. 545 IF I=77 THEN B$=B$+".m2":D$=D$+".m2":LL=464:L=152:L%=256
  54. 550 IF I=8 THEN B$=B$+".96":D$=D$+".96":LL=745:L=248:L%=256
  55. 565 IF I=96 THEN B$=B$+".cfx":D$=D$+".cfx":LL=1638:L%=480:L=546
  56. 570 ML=80+2*L:MLB=INT(ML/256):MLA=ML-256*MLB
  57. 580 MM=2128+2*L:MMB=INT(MM/256):MMA=MM-256*MMB
  58. 590 IF I=7 THEN POKE &H1A8,MLA:POKE &H1A9,MLB:POKE &H241,MLA:POKE &H242,MLB:POKE &H1BF,MMA:POKE &H1C0,MMB
  59. 600 IF I=77 THEN POKE &H1A8,MLA:POKE &H1A9,MLB:POKE &H241,MLA:POKE &H242,MLB:POKE &H1BF,MMA:POKE &H1C0,MMB
  60. 610 LLB=INT(LL/256):LLA=LL-256*LLB:POKE &H1DE,LLA:POKE &H1DF,LLB:POKE &H248,LLA:POKE &H249,LLB:POKE &H1CE,LLA:POKE &H1CF,LLB
  61. 620 JLB=INT(JL/256):JLA=JL-256*JLB:POKE &H1EE,JLA:POKE &H1EF,JLB
  62. 630 LB=INT (L/256):LA=L-256*LB:POKE &H20D,LA:POKE &H20E,LB:POKE &H1FB,LA:POKE &H1FC,LB
  63. 640 ZL=2*L:ZLB=INT(ZL/256):ZLA=ZL-256*ZLB:POKE &H218,ZLA:POKE &H219,ZLB
  64. 650 LB%=INT(L%/256):LA%=L%-256*LB%:POKE &H1BB,LA%:POKE &H1BC,LB%
  65. 660 K=&H100:CALL K(D$,C$,B$,A$)
  66. 670 A$=D$
  67. 675 IF I=96 THEN L=546:LL=1638:P=536:GOTO 1910
  68. 700 BLOAD "vu64ba.asm",&H100
  69. 720 IF I=3 THEN L=288
  70. 730 IF I=3 THEN L=288
  71. 740 IF I=4 THEN L=184
  72. 750 IF I=5 THEN L=256
  73. 760 IF I=6 THEN L=320
  74. 770 IF I=7 THEN GOTO 1180
  75. 780 IF I=77 THEN GOTO 1180
  76. 790 IF I=8 THEN L=248
  77. 800 POKE &H226,2  'No. poked here=pixels scrolled per left arrow depression
  78. 810 POKE &H427,PT
  79. 820 IF I=9 THEN GOTO 1360
  80. 830 P=L-PT:P2=INT(P/256):P1=P-P2*256
  81. 840 POKE &H15D,P1:POKE &H15E,P2:POKE &H45B,P1:POKE &H45C,P2
  82. 850 IF I=4 THEN POKE &H3EA,16:LL=568
  83. 860 IF I=5 THEN POKE &H3EA,0:LL=768
  84. 870 IF I=7 THEN POKE &H3EA,9:LL=915
  85. 880 IF I=77 THEN POKE &H3EA,8:LL=464
  86. 890 IF I=8 THEN POKE &H3EA,1:LL=745
  87. 900 IF I=6 THEN POKE &H3EA,0:LL=960
  88. 910 IF I=3 THEN POKE &H3EA,14:LL=878
  89. 920 IF EX=0 THEN GOTO 960
  90. 930     'next two lines put in expand by 2 for modes desired
  91. 940 IF I=4 THEN P=320:POKE &H43B,235:POKE &H43C,27:POKE &H15A,0:POKE &H15B,2
  92. 950 IF I=77 THEN P=2*P:POKE &H43B,235:POKE &H43C,27:POKE &H15A,0:POKE &H15B,2
  93. 960 OF=(640-2*P)/2:OF2=INT(OF/256):OF1=OF-256*OF2:POKE &H13B,OF1:POKE &H13C,OF2
  94. 970 LL2=INT(LL/256):LL1=LL-256*LL2:POKE &H1FD,LL1:POKE &H1FE,LL2:POKE &H242,LL1:POKE &H243,LL2
  95. 980 IF V=1 THEN GOTO 1020
  96. 990 VC=0:PRINT:PRINT:PRINT"  Is Video Card (1)Trident mode 5D (2)Tseng mode 2E (3)ATI mode 62"
  97. 1000 INPUT"(4)Paradise mode 5F (5)Chips&Tech mode 79 (6)Genoa mode 5C (7)VESA (Default=1)";VC
  98. 1010 IF VC=0 THEN VC=1       'default choice
  99. 1020 IF VC=1 THEN GOTO 1540
  100. 1030 IF VC=2 THEN GOTO 1100
  101. 1040 IF VC=3 THEN GOTO 1560
  102. 1050 IF VC=4 THEN GOTO 1630
  103. 1060 IF VC=5 THEN GOTO 1700
  104. 1070 IF VC=6 THEN GOTO 1760
  105. 1080 IF VC=7 THEN GOTO 1840
  106. 1090 GOTO 990
  107. 1100 POKE &H113,46:POKE &H142,205:POKE &H144,136:POKE &H145,216:POKE &H146,238:POKE &H147,195
  108. 1110 K=&H100
  109. 1120 IF I=99 THEN CALL K(C%,S%,A$):GOTO 1140
  110. 1130 CALL K(S%,A$)
  111. 1140 KEY ON
  112. 1150 PRINT:PRINT:PRINT:PRINT"    If you need to center letters better, hit F2 to re-RUN. If pix is OK"
  113. 1160 PRINT"   and you used d:filename option, hit F10 and ENTER to return to DOS so "
  114. 1170 PRINT"   you can copy the file in d: to whatever name and location you want.":END
  115. 1180 POKE &H180,128:POKE &H3DA,128:POKE &H3CB,64:POKE &H3BC,192
  116. 1190 IF I=77 THEN L=152:GOTO 800
  117. 1200 L=302:GOTO 800
  118. 1210 L=282
  119. 1220 BLOAD "vurobol.asm",&H100
  120. 1230 POKE &H4BD,10:POKE &H350,10      'initial color offset in robot 72
  121. 1240 PT=4     'pixels trimmed on Robot 72
  122. 1250 POKE &H16A,(141-PT):POKE &H3D4,(141-PT)
  123. 1260 POKE &H46A,(76+4*PT)
  124. 1270 POKE &H4D5,(75+4*PT)
  125. 1280 POKE &H337,TU:POKE &H33F,TU:POKE &H2D7,TU:POKE &H2DF,TU
  126. 1290 IF BR=0 THEN POKE &H4EC,208:POKE &H4ED,232:POKE &H4EE,235:POKE &H4EF,4
  127. 1300 IF BR=2 THEN POKE &H4EC,235:POKE &H4ED,6
  128. 1310 OF=(640-2*L)/2:OF2=INT(OF/256):OF1=OF-256*OF2:POKE &H13B,OF1:POKE &H13C,OF2
  129. 1320 POKE &H226,2:POKE &H1FD,102:POKE &H1FE,2:POKE &H242,102:POKE &H243,2:POKE &H15D,102
  130. 1330 IF I=2 THEN GOTO 1350
  131. 1340 POKE &H1FD,85:POKE &H242,85:POKE &H15D,85
  132. 1350 GOTO 980
  133. 1360 POKE &H15D,24:POKE &H15E,2:POKE &H184,235:POKE &H185,1:POKE &H180,0:POKE &H3A8,235:POKE &H3A9,57
  134. 1370 POKE &H3EA,10:POKE &H3A2,224:POKE &H3A3,1:POKE &H13B,52:POKE &H13C,0:POKE &H16A,128:POKE &H16B,2
  135. 1380 LL=546:GOTO 970
  136. 1390 PRINT:PRINT:PRINT:INPUT"   Do you choose (1)1024x768 or (2)640x480 (Default=1)";S
  137. 1400 IF S=0 THEN S=1
  138. 1410 BLOAD "vuwx.asm",&H100
  139. 1420 IF S=2 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1:POKE &H113,93
  140. 1430 PRINT:PRINT:INPUT"   What White level count do you choose (Default=138)";W
  141. 1440 IF W=0 THEN W=138
  142. 1450 POKE &H170,W:POKE &H174,W:POKE &H176,W
  143. 1460 GOTO 990
  144. 1470 BLOAD "vuro36l.asm",&H100
  145. 1480 IF BR=0 THEN POKE &H4EC,208:POKE &H4ED,232:POKE &H4EE,235:POKE &H4EF,4
  146. 1490 IF BR=2 THEN POKE &H4EC,235:POKE &H4ED,6
  147. 1500 POKE &H4BD,8:POKE &H350,8      'initial color offset in robot 36
  148. 1510 LL=616:POKE &H13B,140:POKE &H226,1:POKE &H15D,100:POKE &H1F2,12
  149. 1520 IF I=11 THEN LL=576:POKE &H15D,64:POKE &H3BB,64:POKE &H3EF,0:POKE &H4A8,0:POKE &H441,0:POKE &H2F6,32:POKE &H303,32
  150. 1530 GOTO 970
  151. 1540 IF I=6 THEN POKE &H113,&H5C
  152. 1550 GOTO 1110
  153. 1560 POKE &H113,&H62:POKE &H444,192:POKE 321,235:POKE 322,90  'ATI video mode 62
  154. 1570 POKE 324,136:POKE 325,196
  155. 1580 POKE 326,128:POKE 327,228:POKE 328,225:POKE 329,208:POKE 330,227:POKE 331,8
  156. 1590 POKE 332,220:POKE 333,176:POKE 334,178:POKE 335,254:POKE 336,202:POKE 337,239:POKE 338,195
  157. 1600 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1:POKE 321,233:POKE 322,66:POKE 323,4:POKE &H58A,192
  158. 1610 IF I=6 THEN POKE &H113,&H61
  159. 1620 GOTO 1110
  160. 1630 POKE &H113,&H5F:POKE 321,186:POKE 322,206          'Paradise video mode 5f
  161. 1640 POKE 323,3:POKE 324,176:POKE 325,9:POKE 326,136:POKE 327,220:POKE 328,208
  162. 1650 POKE 329,228:POKE 330,208:POKE 331,228:POKE 332,208:POKE 333,228:POKE 334,208:POKE 335,228
  163. 1660 POKE 336,239:POKE 337,195
  164. 1670 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  165. 1680 IF I=6 THEN POKE &H113,&H5E
  166. 1690 GOTO 1110
  167. 1700 POKE &H113,&H79:POKE 321,186:POKE 322,214            'Chips & Tech Mode 79
  168. 1710 POKE 323,3:POKE 324,176:POKE 325,16:POKE 326,136:POKE 327,220:POKE 328,208
  169. 1720 POKE 329,228:POKE 330,208:POKE 331,228:POKE 332,239:POKE 333,195
  170. 1730 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  171. 1740 IF I=6 THEN POKE &H113,&H78
  172. 1750 GOTO 1110
  173. 1760 POKE &H113,&H5C:POKE 321,186:POKE 322,196                   'Genoa mode 5c
  174. 1770 POKE 323,3:POKE 324,176:POKE 325,6:POKE 326,238:POKE 327,66:POKE 328,236
  175. 1780 POKE 329,36:POKE 330,199:POKE 331,128:POKE 332,227:POKE 333,7:POKE 334,208
  176. 1790 POKE 335,227:POKE 336,208:POKE 337,227:POKE 338,208:POKE 339,227:POKE 340,8
  177. 1800 POKE 341,216:POKE 342,238:POKE 343,195
  178. 1810 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  179. 1820 IF I=6 THEN POKE &H113,&H7E
  180. 1830 GOTO 1110
  181. 1840 POKE &H111,79:POKE &H113,2:POKE 321,177                   'VESA mode 101
  182. 1850 POKE 322,BS:POKE 323,210:POKE 324,227:POKE 325,136:POKE 326,218
  183. 1860 POKE 327,48:POKE 328,246:POKE 329,184:POKE 330,5:POKE 331,79:POKE 332,49:POKE 333,219:POKE 334,205
  184. 1861 POKE 335,16:POKE 336,195
  185. 1870 IF S=1 THEN POKE &H44A,5:GOTO 1900
  186. 1880 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  187. 1890 IF I=6 THEN POKE &H398,0
  188. 1900 GOTO 1110
  189. 1910 BLOAD "trusho.asm",&H100
  190. 1915 P2=INT(P/256):P1=P-256*P2:POKE &H3B0,P1:POKE &H3B1,P2:POKE &H46B,P1:POKE &H46C,P2
  191. 1920 OF=3*(640-P)/2:OF2=INT(OF/256):OF1=OF-256*OF2:POKE &H13C,OF1:POKE &H13D,OF2:POKE &H512,OF1:POKE &H513,OF2
  192. 1925 Z=2*L:ZB=INT(Z/256):ZA=Z-256*ZB:POKE &H3CA,ZA:POKE &H3CB,ZB
  193. 1930 W=2*L+32:WB=INT(W/256):WA=W-256*WB:POKE &H3A9,WA:POKE &H3AA,WB:POKE &H3E5,WA:POKE &H3E6,WB
  194. 1935 LB=INT(L/256):LA=L-256*LB:POKE &H3BC,LA:POKE &H3BD,LB:POKE &H3C3,LA:POKE &H3C4,LB
  195. 1940 U=3*L:UB=INT(U/256):UA=U-256*UB:POKE &H55F,UA:POKE &H560,UB:POKE &H531,UA:POKE &H532,UB
  196. 1945 POKE &H427,10:POKE &H226,2  'poke to &h226 is pixels per left arrow depress
  197. 1950 LL2=INT(LL/256):LL1=LL-256*LL2:POKE &H1FD,LL1:POKE &H1FE,LL2:POKE &H242,LL1:POKE &H243,LL2:POKE &H15D,LL1:POKE &H15E,LL2
  198. 1955 Q=BL-3*P:QB=INT(Q/256):QA=Q-256*QB:POKE &H3D6,QA:POKE &H3D7,QB
  199. 1960 POKE &H39A,233:POKE &H39B,107:POKE &H39C,253:POKE &H11A,0:POKE &H11B,0:POKE &H2B8,235:POKE &H2B9,6:POKE &H3AC,1:POKE &H3B4,1
  200. 1965 POKE &H3A2,224:POKE &H3A3,1
  201. 1970 GOTO 1840
  202. 2000    '                   SYSTEM CONFIGURATION
  203. 2010    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  204. 2020 V=0     'V=0 is manual video card choice---V=1 is automatic choice
  205. 2030 VC=1    'Video card 1=Trident 2=Tseng 3=ATI 4=Paradise 5=Chips 6=Genoa
  206. 2040         '7=VESA (VESA card or VESA driver.Pick BS below to get full pix).
  207. 2045 BS=4    'Bank Shift for different VESA configurations-values from 0 to 6
  208. 2046 BL=2048 'Bytes/Line in TRUCOLOR modes-ATI=1920 and Diamond PRO=2048
  209. 2050 DR$="d" 'RAMDISK drive designation--make letter D match your drive
  210. 2060 BR=2    'Robot brightness control-br=2 is high-br=1 is med-br=0 is low
  211. 2070 TU=2    'Robot tuning increment with F and G in ten's of cycles
  212. 2080 PT=6    'Pixels trimmed from edge of picture--see line 810 for Robot
  213. 2090 EX=1    'For S2 and M2. EX=0 is as rcvd. EX=1 is EXpanded to fill screen
  214. 2100 GOTO 20
  215.