Advertisement
Guest User

Basic 3D Shape Demo

a guest
Aug 17th, 2021
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. ' REM Final Master 3D Shape Demo Finished 2014-01-16
  2. ' REM Coded for miSoft.com Basic! 3.8.2 [email protected]
  3. ' REM Shapes from 80 Microcomputing, May 1981
  4.  
  5.  
  6. off_x = ScreenWidth/4
  7. off_y = ScreenHeight/4
  8. '5 # 4 Leaf Rose-Template
  9. '6 uses polar coordinates and is based on four leaf ros
  10. 'NEW
  11. i = 42
  12. ' REM clear screen
  13. CLS
  14. FOR t = 0 TO 2* PI STEP PI/75
  15. r=COS (2*t)*175
  16. x1=COS(t)*r+80+off_x
  17. y1=SIN(t)*r+80+off_y
  18. a=t+PI/3
  19. r2=COS(2*a)*175
  20. x2=COS(a)*r2+80+off_x
  21. y2=SIN(a)*r2+80+off_y
  22. LINE x1,y1,x2,y2
  23. NEXT t
  24. REM SLEEP 2
  25. PAUSE "Tap screen for next sample"
  26. CLS
  27.  
  28.  
  29. x = 33
  30. '# Disk made with lines
  31. i = 42
  32. FOR t = 0 TO 2* PI STEP PI/50 '40 is density
  33. x1=COS(t)*160+80+off_x '150 is size and 80 is position of center
  34. y1=SIN(t)*160+80+off_y
  35. a=t+3*PI/4 'fractions of pi will give you the relative size of the innwr and outer circles
  36. x2=COS(a)*160+80+off_x
  37. y2=SIN(a)*160 +80 +off_y
  38. LINE X1,Y1,X2,Y2
  39. NEXT t
  40. PAUSE "Tap screen for next sample"
  41. ' REM SLEEP 2
  42.  
  43.  
  44.  
  45.  
  46. CLS
  47. x = 33
  48. '# Box
  49. ' rem figure is made complete of square
  50. i = 42
  51. FOR t = 0 TO 2* PI STEP PI/30
  52. '30 is doubled number of boxes 30 corresponds to 15 boxes
  53. r=COS(2*t)*170
  54. x1=COS(t)*r+80+off_x
  55. y1=SIN(t)*r+80+off_y
  56. a=t+ PI/2
  57. r2=COS(2*a)*170
  58. x2=COS(a)*r2+80+off_x
  59. y2=SIN(a)*r2+80+off_y
  60. LINE X1,Y1,X2,Y2
  61. NEXT t
  62. PAUSE "Tap screen for next sample"
  63. 'REM SLEEP 2
  64.  
  65.  
  66. CLS
  67. x = 33
  68. '# Outward Triangles
  69. ' rem figure made of triangs fig 10 page 144 80 Microcomputing May 1981
  70. i = 42
  71. FOR t=0 TO 1*PI STEP PI/30
  72. ' REM 30 is density (number of triangles)
  73. r=t*60
  74. ' REM this 60 gives you size of triangle
  75. x1=COS(t)*r+100+off_x
  76. y1=SIN(t)*r+100+off_y
  77. a=t+(2*PI/3)
  78. x2=COS(a)*r+100+off_x
  79. y2=SIN(a)*r+100+off_y
  80. LINE x1,y1,x2,y2
  81. b=t+(4*PI/3)
  82. x1=COS(b)*r+100+off_x
  83. y1=SIN(b)*r+100+off_y
  84. LINE x1,y1,x2,y2
  85. x2=COS(t)*r+100+off_x
  86. y2=SIN(t)*r+100+off_y
  87. LINE x1,y1,x2,y2
  88. NEXT t
  89. PAUSE "Tap screen for next sample"
  90. ' REM SLEEP 2
  91.  
  92.  
  93. CLS
  94. x = 33
  95. ' REM wait for input
  96. 'RUN
  97. '# Cyclone Spiral w/ lines
  98. 'rem overlapping sprial made of 200 lines
  99. i = 42
  100. ' REM clear screen
  101. 'FOR t = 0 TO 15*PI STEP PI/20
  102. x1=COS(t)*5*t+80+off_x
  103. y1=SIN(t)*5*t+80+off_y
  104. a=t+2*PI/3
  105. x2=COS(a)*5*a+80+off_x
  106. y2=SIN(a)*5*a+80+off_y
  107. LINE x1,y1,x2,y2
  108. NEXT t
  109. PAUSE "Tap screen for next sample"
  110. 'REM SLEEP 2
  111. CLS
  112.  
  113.  
  114.  
  115. x = 33
  116. '# 8 Leaf Rose
  117. 'REM this is based on an eight leaf rose ; the small star in the center was an accident
  118. i = 42
  119. FOR t=0 TO 2*PI STEP PI/60
  120. r=COS(4*t)*200
  121. x1=COS(t)*r+80+off_x
  122. y1=SIN(t)*r+80+off_y
  123. a=t+PI/4
  124. r2=COS(4*a)*200
  125. x2=COS(a)*r2+80+off_x
  126. y2=SIN(a)*r2+80+off_y
  127. LINE x1,y1,x2,y2
  128. NEXT t
  129. PAUSE "Tap screen for next sample"
  130. 'REM SLEEP 2
  131.  
  132.  
  133.  
  134. CLS
  135. x = 33
  136. '# Inward Triangles
  137. r=1
  138. i = 42
  139. 'REM clear screen
  140. FOR t=0 TO 3.64 STEP PI/30
  141. r=r*1.17557
  142. x1=COS(t)*r+80+off_x
  143. y1=SIN(t)*r+80+off_y
  144. a=t+(2*PI/3)
  145. x2=COS(a)*r+80+off_x
  146. y2=SIN(a)*r+80+off_y
  147. LINE x1,y1,x2,y2
  148. b=t+(4*PI/3)
  149. x1=COS(b)*r+80+off_x
  150. y1=SIN(b)*r+80+off_y
  151. LINE x1,y1,x2,y2
  152. x2=COS(t)*r+80+off_x
  153. y2=SIN(t)*r+80+off_y
  154. LINE x1,y1,x2,y2
  155. NEXT t
  156. PAUSE "Tap screen for next sample"
  157. 'REM SLEEP 2
  158.  
  159.  
  160.  
  161.  
  162. CLS
  163. x = 33
  164. '#figure 1 (a CIRCLE with internal connecting lines) then a string art border
  165. i = 42
  166. INPUT"number of points (sample has 18) ",n
  167. DIM a(n), b(n)
  168. FOR t =0 TO 2*PI-.001 STEP 2*PI/n
  169. z=z+1
  170. 'REM PRINT z
  171. a(z)=COS(t)*100+80
  172. b(z)=SIN(t)*100+80
  173. NEXT t
  174. FOR s=1 TO n-1
  175. FOR d=s+1 TO n
  176. x1=a(s)+75
  177. y1=b(s)+75
  178. x2=a(d)+75
  179. y2=b(d)+75
  180. LINE x1,y1,x2,y2
  181. NEXT d
  182. NEXT s
  183.  
  184. x = 33
  185. '# Parabola string art border
  186. i = 42
  187. FOR q= 5 TO 300 STEP 9
  188. x1=5
  189. y1=q
  190. x2=q
  191. y2=300
  192. LINE x1,y1,x2,y2
  193. x1=q
  194. y1=5
  195. x2=300
  196. y2=q
  197. LINE x1,y1,x2,y2
  198. NEXT q
  199. PAUSE "Tap screen for next sample"
  200. 'REM SLEEP 2
  201.  
  202.  
  203.  
  204.  
  205.  
  206. CLS
  207. z = 0
  208. INPUT"number of points (sample has 18) ",n
  209. DIM a(n+1), b(n+1)
  210. FOR t =0 TO 2*PI-.001 STEP 2*PI/n
  211. z=z+1
  212. a(z)=COS(t)*180+80
  213. b(z)=SIN(t)*180+80
  214. NEXT t
  215. FOR s=1 TO n-1
  216. FOR d=s+1 TO n
  217. x1=a(s)+off_x
  218. y1=b(s)+off_y+25
  219. x2=a(d)+off_x
  220. y2=b(d)+off_y+25
  221. LINE x1,y1,x2,y2
  222. NEXT d
  223. NEXT s
  224. PAUSE "Tap screen for next sample"
  225. 'REM SLEEP 2
  226.  
  227.  
  228. CLS
  229. '# The tunnel
  230. x1=80
  231. y1=80
  232. FOR t=1 TO 64
  233. x2=x1+(5*t)+2
  234. y2=y1
  235. LINE x1,y1,x2,y2
  236. x1=x2
  237. y1=y2+(5*t)+3
  238. LINE x1,y1,x2,y2
  239. x2=x1-(5*t)-5
  240. y2=y1
  241. LINE x1,y1,x2,y2
  242. x1=x2
  243. y1=y2-(5*t)-6
  244. LINE x1,y1,x2,y2
  245. NEXT t
  246. PAUSE "Tap screen for next sample"
  247.  
  248.  
  249.  
  250. 'REM moire pattern
  251. CLS
  252. FOR tt = 0 TO PI STEP PI/180
  253. x1=100*COS(tt)
  254. y1=100*SIN(tt)
  255. x2=300*COS(tt)
  256. y2=300*SIN(tt)
  257. LINE x1,y1,x2,y2
  258. x1=300-x1
  259. y1=300-y1
  260. x2=300-x2
  261. y2=300-y2
  262. LINE x1,y1,x2,y2
  263. NEXT tt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement