PlasmaJVSH.bas


'Plasma generator
'This program creates a plasma surface, which looks oily or silky.

r=rnd:g=rnd:b=rnd
for
n=1 to 5
r1=r:g1=g:b1=b
repeat:r=rnd:until abs(r-r1)>.3
repeat:g=rnd:until abs(g-g1)>.3
repeat:b=rnd:until abs(g-g1)>.3
for m=0 to 17:m1=17-m
f1=(m*r)/18:f2=(m*g)/18:f3=(m*b)/18:c << rgbf(f1,f2,f3)
next
for m=0 to 17:m1=17-m
f1=(m+m1*r)/18:f2=(m+m1*g)/18:f3=(m+m1*b)/18:c << rgbf(f1,f2,f3)
next
for m=0 to 17:m1=17-m
f1=(m1+m*r)/18:f2=(m1+m*g)/18:f3=(m1+m*b)/18:c << rgbf(f1,f2,f3)
next
for m=0 to 17:m1=17-m
f1=(m1*r)/18:f2=(m1*g)/18:f3=(m1*b)/18:c << rgbf(f1,f2,f3)
next
next

for
n=1 to 6
p << [rnd*xmax,rnd*ymax]
f << rnd*.1
next
n
for
y=0 to ymax-1 step 2
for x=0 to xmax-1 step 2
d=0
for n=0 to 5
k=sqr((x-p(n)(0))^2+(y-p(n)(1))^2)
d =d+(sin(k*f(n))+1)/2
next n:d=d*60
rect x,y step 2,2 color c(d) filled
next x
next
y