home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 4 / AUCD4.iso / acornuser / 1998 / apr1998 / regulars / StarInfo / Stoner / Satin2 (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1997-06-30  |  2KB  |  94 lines

  1.  True Plasma Drawer
  2.  by Nigel Stoner 1997
  3. doit:
  4. " in line ";
  5. setpal
  6.     ti%=
  7. fullscrn
  8. -ti%)/100))
  9. <>22 
  10.  "OS_SWINumberFromString",,"ColourTrans_SetGCOL" 
  11.  col%
  12.  cx%(16),cy%(16),pal%(255)
  13. pickcs
  14.  x%,y%,b%,ox%,oy%
  15.  x%=0 
  16.  1280 
  17. x%,0,1,1024:
  18. 0,x%*.75,1280,1:
  19. 0,10)"Place your attractors with Select"
  20. centre%=3:
  21.  3,15
  22.  a%=0 
  23.  centre%:
  24. x%,y%,b%:
  25. b%=0:ox%=x%:oy%=y%:
  26. x%,y%,128
  27.  x%,y%,b%
  28.  ox%<>x% 
  29.  oy%<>y% 
  30. ox%,oy%,128:ox%=x%:oy%=y%:
  31. ox%,oy%,128
  32.  b%=4:cx%(a%)=x%:cy%(a%)=y%:
  33. setpal
  34.  set pallette
  35.  a%=0 
  36. a%,a%*16,a%*16,a%*16::
  37. fullscrn
  38. centre%=3:
  39. pickcs
  40. 0,12)"Enter Band Width (1-99)";
  41.  band:
  42.  band >0 
  43.  band <100
  44. band=1-(band/100) 
  45. *"over%=8:start%=0:iter%=over%:
  46.  y%= start% 
  47.  512-over% 
  48.  over%:
  49.  x%= start% 
  50.  1280-over% 
  51.  over%:xsum%=0:ysum%=0:
  52.  a%=0 
  53.  centre%:dx%=cx%(a%)-x%:dy%=cy%(a%)-y%:d2%=dx%*dx%+dy%*dy%
  54.  d2%<>0  adj%=(dx%*dy%):x2%=(dx%*adj%)>>7:y2%=(dx%*adj%)>>7:xsum%+=(x2%*cx%(a%))/d2%:ysum%+=(y2%*cy%(a%))/d2% 
  55.  a%=centre%+1
  56.  a%:d%=
  57. (xsum%^2+ysum%^2):tx%=d%*band 
  58.  256:
  59. col%,(tx%<<8)+(tx%<<16)+(tx%<<24),,,&100:
  60. x%,y%,over%-4:
  61. 1268-x%+over%,1020-y%,-over%+4:
  62. x%,y%
  63. . over%=4:start%=0:iter%=over%
  64.  y%= start%+512 
  65.  1024-over% 
  66.  over%:
  67.  x%= start% 
  68.  1280-over% 
  69.  over%*2:xsum%=0:ysum%=0:
  70.  a%=0 
  71.  centre%:dx%=cx%(a%)-x%:dy%=cy%(a%)-y%:d2%=dx%*dx%+dy%*dy%
  72.  d2%<>0  adj%=(dx%*dy%):x2%=(dx%*adj%)>>7:y2%=(dx%*adj%)>>7:xsum%+=(x2%*cx%(a%))/d2%:ysum%+=(y2%*cy%(a%))/d2% 
  73.  a%=centre%+1
  74.  a%:d%=
  75. (xsum%^2+ysum%^2):tx%=d%*band 
  76.  256:
  77. col%,(tx%<<8)+(tx%<<16)+(tx%<<24),,,&100:
  78. 69,x%,y%:
  79. 69,1272-x%+over%,1024-y%:
  80. x%:start%=start%
  81. over%:
  82. cycle:
  83. cycle
  84. /7.6 
  85. 15:r%=16*
  86. (t%/9+60)+18:g%=16*
  87. (t%/8)+18:b%=15*
  88. (t%/7+120)+18:
  89.  a%=0 
  90. (a%+n%)
  91. 16,a%*r%,a%*g%,a%*b%:
  92. (15-a%+n%)
  93. 16,a%*r%,a%*g%,a%*b%:
  94.