'=========================================================================== ' Subject: SHAPE-SHIFTING PLASMA 2 Date: 05-24-97 (15:20) ' Author: Daniel Davies Code: QB, QBasic, PDS ' Origin: ia53@rapid.co.uk Packet: GRAPHICS.ABC '=========================================================================== 'SHAPESHIFTING PLASMA 2 BY Daniel Davies 'this is a sinusoidal plasma which I wrote ages ago, and have recently 'modified to run fast enough to generate an animated plasma. 'I've also converted this into 'I haven't got a web site yet but I've almost finished it, but in the meantime 'if you want to contact me, my email address is - ia53@rapid.co.uk DIM PLASMA%(80, 50) DIM sine1%(0 TO 360) DIM sine2%(0 TO 360) DIM sine3%(0 TO 360) DIM sine4%(0 TO 360) DIM red%(0 TO 255) DIM green%(0 TO 255) DIM blue%(0 TO 255) SCREEN 13 DEF SEG = &HA000 FOR a% = 0 TO 255 READ red%(a%), green%(a%), blue%(a%) OUT &H3C8, a% OUT &H3C9, red%(a%) OUT &H3C9, green%(a%) OUT &H3C9, blue%(a%) NEXT a% rtd = 3.141592654# / 180 FOR y% = 0 TO 360 'temporary sine1%(y%) = -(31 * SIN((y% * 7) * rtd)) sine2%(y%) = -(6 * SIN((y% * 3) * rtd)) sine3%(y%) = (19 * SIN((y% * 10) * rtd)) sine4%(y%) = (44 * SIN((y% * 5) * rtd)) NEXT y% DO s1tmp% = sine1%(0) s3tmp% = sine3%(0) FOR x% = 0 TO 359 sine1%(x%) = sine1%(x% + 1) sine3%(x%) = sine3%(x% + 1) NEXT x% sine1%(360) = s1tmp% sine3%(360) = s3tmp% s2tmp% = sine2%(360) s4tmp% = sine4%(360) FOR x% = 360 TO 1 STEP -1 sine2%(x%) = sine2%(x% - 1) sine4%(x%) = sine4%(x% - 1) NEXT x% sine2%(0) = s2tmp% sine4%(0) = s4tmp% ymod& = 0 FOR y% = 0 TO 49 FOR x% = 0 TO 79 x2% = x% * 4 st1% = sine1%(x%) + sine2%(x%) st2% = sine3%(y%) + sine4%(y%) col% = ((st2% + (((st1% + y%) MOD 254) + 1)) MOD 254) + 127 col% = st1% - st2% + 127 POKE x2% + ymod&, col%: POKE x2% + ymod& + 1, col% POKE x2% + ymod& + 2, col%: POKE x2% + ymod& + 3, col% POKE x2% + ymod& + 320, col%: POKE x2% + ymod& + 321, col% POKE x2% + ymod& + 322, col%: POKE x2% + ymod& + 323, col% POKE x2% + ymod& + 640, col%: POKE x2% + ymod& + 641, col% POKE x2% + ymod& + 642, col%: POKE x2% + ymod& + 643, col% POKE x2% + ymod& + 960, col%: POKE x2% + ymod& + 961, col% POKE x2% + ymod& + 962, col%: POKE x2% + ymod& + 963, col% NEXT x% ymod& = ymod& + 1280& NEXT y% LOOP WHILE INKEY$ = "" DATA 15,15,15,16,15,15,18,15,15,19,14,14,21,14,14,22,13,13,24,13,13,25,12,12,27,12,12 DATA 28,11,11,30,11,11,32,10,10,33,10,10,35,9,9,36,9,9,38,8,8,39,8,8,41,7,7,42,7,7 DATA 44,6,6,45,6,6,47,5,5,49,5,5,50,4,4,52,4,4,53,3,3,55,3,3,56,2,2,58,2,2,59,1,1,61,1,1 DATA 63,0,0,63,1,0,63,3,0,63,5,0,63,7,0,63,9,0,63,11,0,63,13,0,63,15,0,63,17,0,63,19,0 DATA 63,21,0,63,23,0,63,25,0,63,27,0,63,29,0,63,31,0,63,33,0,63,35,0,63,37,0,63,39,0 DATA 63,41,0,63,43,0,63,45,0,63,47,0,63,49,0,63,51,0,63,53,0,63,55,0,63,57,0,63,59,0 DATA 63,61,0,63,63,0,63,63,1,63,63,3,63,63,5,63,63,7,63,63,9,63,63,11,63,63,13,63,63,15 DATA 63,63,17,63,63,19,63,63,21,63,63,23,63,63,25,63,63,27,63,63,29,63,63,31,63,63,33 DATA 63,63,35,63,63,37,63,63,39,63,63,41,63,63,43,63,63,45,63,63,47,63,63,49,63,63,51 DATA 63,63,53,63,63,55,63,63,57,63,63,59,63,63,61,63,63,63,63,63,63,63,62,62,63,62,61 DATA 63,61,60,63,61,59,63,60,58,63,60,57,63,59,56,63,59,55,63,58,54,63,58,53,63,57,52 DATA 63,57,51,63,56,50,63,56,49,63,55,48,63,55,47,63,54,46,63,54,45,63,53,44,63,53,43 DATA 63,52,42,63,52,41,63,51,40,63,51,39,63,50,38,63,50,37,63,49,36,63,49,35,63,48,34 DATA 63,48,33,63,47,32,63,46,31,63,46,30,63,45,29,63,45,28,63,44,27,63,44,26,63,43,25 DATA 63,43,24,63,42,23,63,42,22,63,41,21,63,41,20,63,40,19,63,40,18,63,39,17,63,39,16 DATA 63,38,15,63,38,14,63,37,13,63,37,12,63,36,11,63,36,10,63,35,9,63,35,8,63,34,7 DATA 63,34,6,63,33,5,63,33,4,63,32,3,63,32,2,63,31,1,63,30,0,63,30,0,63,29,0,63,28,0 DATA 63,27,0,63,26,0,63,25,0,63,24,0,63,23,0,63,22,0,63,21,0,63,20,0,63,19,0,63,18,0 DATA 63,17,0,63,16,0,63,15,0,63,15,0,63,14,0,63,13,0,63,12,0,63,11,0,63,10,0,63,9,0 DATA 63,8,0,63,7,0,63,6,0,63,5,0,63,4,0,63,3,0,63,2,0,63,1,0,63,0,0,63,0,0,62,0,0 DATA 61,0,0,61,0,0,60,0,0,59,0,0,58,0,0,58,0,0,57,0,0,56,0,0,56,0,0,55,0,0,54,0,0 DATA 53,0,0,53,0,0,52,0,0,51,0,0,51,0,0,50,0,0,49,0,0,48,0,0,48,0,0,47,0,0,46,0,0 DATA 46,0,0,45,0,0,44,0,0,43,0,0,43,0,0,42,0,0,41,0,0,40,0,0,40,0,0,39,1,1,38,1,1 DATA 37,2,2,36,2,2,35,3,3,35,3,3,34,4,4,33,4,4,32,5,5,31,5,5,30,6,6,30,6,6,29,7,7 DATA 28,7,7,27,8,8,26,8,8,25,9,9,25,9,9,24,10,10,23,10,10,22,11,11,21,11,11,20,12,12 DATA 20,12,12,19,13,13,18,13,13,17,14,14,16,14,14,15,15,15,15,15,15,15,15,15 DATA 999,999,999