Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plasma Studies
#11
But then johnno would request:
Code: (Select All)
_Title "Ansii Plasma Colorized - press spacebar for new set of points, be sure to swirl your mouse in the stuff!" ' b+ 2021-11-11
' 2021-11-13 colorize version
_ScreenMove 100, 40

Type xy
    x As Single
    y As Single
    dx As Single
    dy As Single
End Type

Randomize Timer
Screen _NewImage(1200, 640, 32)

'Width 150, 80
_Font 8

nP = 6
Dim p(1 To nP) As xy, f(6)

restart:
For n = 1 To nP
    p(n).x = Rnd * _Width: p(n).y = Rnd * _Height: p(n).dx = .25 * (Rnd * 2 - 1): p(n).dy = 2 * (Rnd * 2 - 1)
    f(n) = n * .015
Next

While _KeyDown(27) = 0
    Cls
    If InKey$ = " " Then GoTo restart
    For i = 1 To nP - 1
        p(i).x = p(i).x + p(i).dx
        If p(i).x > _Width - 1 Or p(i).x < 1 Then p(i).dx = -p(i).dx
        If p(i).x < 1 Then p(i).x = 1: If p(i).x > _Width Then p(i).x = _Width
        p(i).y = p(i).y + p(i).dy
        If p(i).y > _Height Or p(i).y < 1 Then p(i).dy = -p(i).dy
        If p(i).y < 1 Then p(i).y = 1: If p(i).y > _Height Then p(i).y = _Height
    Next
    While _MouseInput: Wend
    p(nP).x = _MouseX \ 8: p(nP).y = _MouseY \ 8
    For y = 1 To 80
        For x = 1 To 150
            d = 0
            For n = 1 To nP
                dx = x - p(n).x: dy = y - p(n).y
                k = Sqr(dx * dx + dy * dy)
                d = d + (Sin(k * f(n)) + 1) / 2
            Next
            Color _RGB32(0, 0, d * 50)
            _PrintString ((x - 1) * 8, (y - 1) * 8), Chr$(Int(d * 20))
        Next
    Next
    _Display
    _Limit 40
Wend


Attached Files Image(s)
   
b = b + ...
Reply
#12
I love this thread.  Great plasmas, @bplus.  I didn't have the lava lamp one.  It's Cool.  I don't understand how they all work, but they sure are fun to tinker with!

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#13
Thanks Dav, I don't fully understand them either but tinkering helps that understanding Big Grin
b = b + ...
Reply
#14
nice effect
Reply
#15
Nice record with the screenshots, B+, pretty interesting
Reply




Users browsing this thread: 7 Guest(s)