'=========================================================================== ' Subject: SHAPE-SHIFTING PLASMA 3 Date: 05-24-97 (15:20) ' Author: Daniel Davies Code: QB, QBasic, PDS ' Origin: ia53@rapid.co.uk Packet: GRAPHICS.ABC '=========================================================================== 'SHAPESHIFTING PLASMA BY Daniel Davies 'this is a sinusoidal plasma which I wrote about a year ago, and have 'modified to run fast enough to generate an animated plasma about 6 months ago 'but until now I haven't been able to post it on the net, because I didn't 'have internet access. 'I've also converted this to asic, so that I could compile it, the compiled 'form is movplas.exe, this is much smoother than this version. '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 DIM rsin1%(360) DIM rsin2%(360) DIM rsin3%(360) DIM gsin1%(360) DIM gsin2%(360) DIM gsin3%(360) DIM bsin1%(360) DIM bsin2%(360) DIM bsin3%(360) FOR x% = 0 TO 360 rsin1%(x%) = (SIN(x% * 2 * (3.141592653# / 180)) * 17) rsin2%(x%) = (SIN(x% * 4 * (3.141592653# / 180)) * 13) rsin3%(x%) = (SIN(x% * 6 * (3.141592653# / 180)) * 7) gsin1%(x%) = (SIN((x% + 120) * 2 * (3.141592653# / 180)) * 17) gsin2%(x%) = (SIN((x% + 120) * 4 * (3.141592653# / 180)) * 13) gsin3%(x%) = (SIN((x% + 120) * 6 * (3.141592653# / 180)) * 7) bsin1%(x%) = (SIN((x% + 240) * 2 * (3.141592653# / 180)) * 17) bsin2%(x%) = (SIN((x% + 240) * 4 * (3.141592653# / 180)) * 13) bsin3%(x%) = (SIN((x% + 240) * 6 * (3.141592653# / 180)) * 7) NEXT x% 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% FOR y% = 0 TO 36 ymod& = (y% * 4) * 320& FOR x% = 1 TO 36 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 PSET (x%, y%), col% PSET (72 - x%, 72 - y%), col% PSET (x%, 72 - y%), col% PSET (72 - x%, y%), col% NEXT x% NEXT y% 'FOR x% = 0 TO 255 'OUT &H3C8, x% 'OUT &H3C9, rsin1%(x%) + rsin2%(x%) + rsin3%(x%) + 30 'OUT &H3C9, gsin1%(x%) + gsin2%(x%) + gsin3%(x%) + 30 'OUT &H3C9, bsin1%(x%) + bsin2%(x%) + bsin3%(x%) + 30 'NEXT x% r1tmp% = rsin1%(0) r3tmp% = rsin3%(0) g2tmp% = gsin2%(0) b1tmp% = bsin1%(0) b3tmp% = bsin3%(0) r2tmp% = rsin2%(360) g1tmp% = gsin1%(360) g3tmp% = gsin3%(360) b2tmp% = bsin2%(360) FOR x% = 0 TO 359 rsin1%(x%) = rsin1%(x% + 1) rsin3%(x%) = rsin3%(x% + 1) gsin2%(x%) = gsin2%(x% + 1) bsin1%(x%) = bsin1%(x% + 1) bsin3%(x%) = bsin3%(x% + 1) NEXT x% FOR x% = 360 TO 1 STEP -1 rsin2%(x%) = rsin2%(x% - 1) gsin1%(x%) = gsin1%(x% - 1) gsin3%(x%) = gsin3%(x% - 1) bsin2%(x%) = bsin2%(x% - 1) NEXT x% rsin1%(360) = r1tmp% rsin3%(360) = r3tmp% gsin2%(360) = g2tmp% bsin1%(360) = b1tmp% bsin3%(360) = b3tmp% rsin2%(0) = r2tmp% gsin1%(0) = g1tmp% gsin3%(0) = g3tmp% bsin2%(0) = b2tmp% LOOP WHILE INKEY$ = ""