10-02-2024, 01:06 PM
Hey, bplus, I thought you may like like this little proggie since you have shared some really great plasmas here. I wondered what it would look like to show more than one plasma effect using a pulse factor to blend them. Here's a little example of that.
- Dav
- Dav
Code: (Select All)
Screen _NewImage(800, 600, 32)
cx = _Width / 2
cy = _Height / 2
Do
t = Timer
pulse = Sin(t) * .8 'pulse factor
For y = 0 To _Height Step 3
For x = 0 To _Width Step 3
a = _Atan2(y - cy, x - cx) + t
rad = Sqr((x - cx) ^ 2 + (y - cy) ^ 2) / 100
'1st plasma colors
r1 = (Sin(rad * 2 + t) + Sin(a * 5 + t)) * 127 + 128
g1 = (Sin(rad * 2 + t + 1) + Sin(a * 5 + t + 1)) * 127 + 128
b1 = (Sin(rad * 2 + t + 2) + Sin(a * 5 + t + 2)) * 127 + 128
'2nd plasma colors
r2 = (Sin(rad * 3 + t) + Sin(a * 3 + t + 1)) * 127 + 128
g2 = (Sin(rad * 3 + t + 2) + Sin(a * 3 + t + 3)) * 127 + 128
b2 = (Sin(rad * 3 + t + 4) + Sin(a * 3 + t + 4)) * 127 + 128
'Blend plasma colors using pulse factor
r = r1 * (1 - pulse) + r2 * pulse
g = g1 * (1 - pulse) + g2 * pulse
b = b1 * (1 - pulse) + b2 * pulse
Line (x, y)-Step(2, 2), _RGB(r, g, b), BF
Next
Next
_Display
_Limit 30
Loop Until InKey$ <> ""