Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Proggies
(10-03-2024, 11:04 PM)Dav Wrote: Here's a few more, that's about all I think.

- Dav

Code: (Select All)
            a = _Atan2(y - cy, x - cx) + Cos(t) * 3 + Sin(x / _Width + t * 3) 'better wave
            a = _Atan2(y - cy, x - cx) + Sin(t * 2) * Cos(rad * 2) 'double twist!
            a = _Atan2(y - cy, x - cx) + Sin(rad * 1.5 + t * 4) 'inward spiral
            a = _Atan2(y - cy, x - cx) + Sin(x * .01 + t) * Cos(y * .01 + t) 'mumps!
I wanted to see all the variations so this version lets you cycle through them by pressing the "a" key... 

Code: (Select All)
_Title "Dav 'Pulse' Plasma Blend: press 'a' to change angle style, any other key for random, esc to quit"
' 2024-10-02 Dav      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.
' 2024-10-02 b+       thank you Dav for nice blended plasma effect, now I play with it :D
' 2024-10-03 Dav      Hey, bplus, I really like your mod.   Played around with the angles today, to come up with a few variations,  Replace the original angle (a) line with one of these to see the different effects achieved manipulating the angle.
' 2024-10-03 Dav      Here's a few more, that's about all I think.
' 2024-10-07 madscijr added press A to cycle through formulas

Const FALSE = 0
Const TRUE = Not FALSE
Dim bFinished As Integer
Dim bRestart As Integer
Dim bChange As Integer
Dim iLastKey As Integer
Dim iAngleFn As Integer
Dim iMaxAngleFn As Integer
Dim cx As Integer
Dim cy As Integer
Dim m1 As Integer
Dim m2 As Integer
Dim m3 As Integer

Screen _NewImage(800, 600, 32)
_ScreenMove 250, 60

bFinished = FALSE
bRestart = TRUE
iAngleFn = 0
iMaxAngleFn = 11

Do
    If bRestart = TRUE Then
        ' Init values
        cx = _Width / 2
        cy = _Height / 2
        m1 = 9
        m2 = 27
        m3 = 3

        ' Choose a new formula
        'iAngleFn = RandomNumber%(1, iMaxAngleFn)
        iAngleFn = iAngleFn + 1: If iAngleFn > iMaxAngleFn Then iAngleFn = 1

        '' Display in title bar
        '_Title "Dav 'Pulse' Plasma Blend: angle style " + _Trim$(Str$(iAngleFn)) + " (press a to change, any other key for random, esc to quit)"

        ' Don't run again until user presses "a" again
        bRestart = FALSE
    ElseIf bChange = TRUE Then
        ' Randomize values
        m3 = Int(Rnd * 12)
        m = Int(Rnd * 3) + 2
        m1 = m * m3
        m2 = m * m1

        ' Don't run again until user presses "b"
        bChange = FALSE
    End If

    T = T + .01 ' mod
    pulse = Sin(T) * .8 'pulse factor

    For y = 0 To _Height Step 3
        For x = 0 To _Width Step 3

            ' --------------------------------------------------------------------------------
            ' case 1
            ' bplus
            ' 10-02-2024, 04:45 PM (This post was last modified: 10-02-2024, 04:47 PM by bplus.)
            ' #207 OK here is a mod Smile
            ' --------------------------------------------------------------------------------
            ' Case 2-7
            ' Dav
            ' 10-03-2024, 03:31 PM
            ' #210: Hey, bplus, I really like your mod.
            ' Played around with the angles today, to come up with a few variations,
            ' Replace the original angle (a) line with one of these
            ' to see the different effects achieved manipulating the angle.
            ' --------------------------------------------------------------------------------
            ' case 8-11
            ' Dav
            ' 10-03-2024, 07:04 PM
            ' #212 Here's a few more, that's about all I think.
            ' --------------------------------------------------------------------------------

            Select Case iAngleFn
                Case 1:
                    a = _Atan2(y - cy, x - cx) + T 'original
                Case 2:
                    a = _Atan2(y - cy, x - cx) + Sin(rad * 2 + T) 'spiral twist
                Case 3:
                    a = _Atan2(y - cy, x - cx) + Sin(T) * 4 'churning using sin
                Case 4:
                    a = _Atan2(y - cy, x - cx) + Cos(T) * 4 'churning using cos
                Case 5:
                    a = _Atan2(y - cy, x - cx) + Sin(T) * rad 'spiral (radius)
                Case 6:
                    a = _Atan2(y - cy, x - cx) + Sin(T * 4 + (x / _Width)) * .5 'edge wave
                Case 7:
                    a = _Atan2(y - cy, x - cx) + (x / _Width) * Sin(T) * 5 'distort
                Case 8:
                    a = _Atan2(y - cy, x - cx) + Cos(T) * 3 + Sin(x / _Width + T * 3) 'better wave
                Case 9:
                    a = _Atan2(y - cy, x - cx) + Sin(T * 2) * Cos(rad * 2) 'double twist!
                Case 10:
                    a = _Atan2(y - cy, x - cx) + Sin(rad * 1.5 + T * 4) 'inward spiral
                Case 11:
                    a = _Atan2(y - cy, x - cx) + Sin(x * .01 + T) * Cos(y * .01 + T) 'mumps!
            End Select

            rad = Sqr((x - cx) ^ 2 + (y - cy) ^ 2) / 100

            '1st plasma colors
            r1 = (Sin(rad * m3 + T) + Sin(a * m1 + T)) * 127 '+ 128
            g1 = (Sin(rad * m3 + T + 1) + Sin(a * m1 + T + 1)) * 127 '+ 128
            b1 = (Sin(rad * m3 + T + 2) + Sin(a * m1 + 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 * m2 + T + 3)) * 127 + 128
            b2 = (Sin(rad * 3 + T + 4) + Sin(a * m2 + 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 x
    Next y

    Locate 1, 1: Print _Trim$(Str$(iAngleFn))

    _Display
    _Limit 30

    If _KeyDown(27) Then
        bFinished = TRUE
    ElseIf _KeyDown(Asc("a")) Then
        If iLastKey <> Asc("a") Then ' don't let user hold down "a" key
            bRestart = TRUE
            iLastKey = Asc("a")
        End If
    Else
        iLastKey = 0
        If InKey$ <> "" Then
            bChange = TRUE
        End If
    End If
Loop Until bFinished = TRUE ' _KeyDown(27)

End

' /////////////////////////////////////////////////////////////////////////////
' Generate random value between Min and Max inclusive.

Function RandomNumber% (Min%, Max%)
    Dim NumSpread%

    ' SET RANDOM SEED
    'Randomize ' Initialize random-number generator.
    Randomize Timer

    ' GET RANDOM # Min%-Max%
    'RandomNumber = Int((Max * Rnd) + Min) ' generate number

    NumSpread% = (Max% - Min%) + 1

    RandomNumber% = Int(Rnd * NumSpread%) + Min% ' GET RANDOM # BETWEEN Max% AND Min%
End Function ' RandomNumber%
Reply


Messages In This Thread
Proggies - by bplus - 04-24-2022, 04:02 PM
RE: Proggies - by bplus - 04-26-2022, 03:23 PM
RE: Proggies - by bplus - 04-26-2022, 04:24 PM
RE: Proggies - by bplus - 05-01-2022, 12:10 AM
RE: Proggies - by dcromley - 05-01-2022, 04:00 AM
RE: Proggies - by bplus - 05-01-2022, 02:52 PM
RE: Proggies - by bplus - 05-01-2022, 02:56 PM
RE: Proggies - by bplus - 05-01-2022, 08:05 PM
RE: Proggies - by bplus - 05-03-2022, 01:43 AM
RE: Proggies - by vince - 05-03-2022, 02:13 AM
RE: Proggies - by bplus - 05-03-2022, 02:16 AM
RE: Proggies - by bplus - 05-08-2022, 02:13 AM
RE: Proggies - by OldMoses - 05-08-2022, 12:40 PM
RE: Proggies - by bplus - 05-08-2022, 03:16 PM
RE: Proggies - by bplus - 05-16-2022, 12:21 AM
RE: Proggies - by bplus - 05-16-2022, 12:58 AM
RE: Proggies - by PhilOfPerth - 05-16-2022, 01:40 AM
RE: Proggies - by bplus - 05-16-2022, 01:28 AM
RE: Proggies - by SMcNeill - 05-16-2022, 12:49 PM
RE: Proggies - by bplus - 05-16-2022, 02:44 PM
RE: Proggies - by bplus - 05-17-2022, 11:16 PM
RE: Proggies - by vince - 05-25-2022, 05:08 AM
RE: Proggies - by bplus - 05-17-2022, 11:23 PM
RE: Proggies - by bplus - 05-17-2022, 11:42 PM
RE: Proggies - by bplus - 05-18-2022, 01:14 AM
RE: Proggies - by bplus - 05-19-2022, 06:43 PM
RE: Proggies - by bplus - 05-20-2022, 01:52 AM
RE: Proggies - by SierraKen - 05-20-2022, 03:44 AM
RE: Proggies - by bplus - 05-20-2022, 07:59 PM
RE: Proggies - by bplus - 05-20-2022, 08:34 PM
RE: Proggies - by Dav - 05-21-2022, 12:48 AM
RE: Proggies - by bplus - 05-25-2022, 12:47 AM
RE: Proggies - by bplus - 05-29-2022, 11:32 PM
RE: Proggies - by bplus - 05-30-2022, 01:41 PM
RE: Proggies - by bplus - 06-04-2022, 10:01 PM
RE: Proggies - by triggered - 06-05-2022, 03:44 AM
RE: Proggies - by bplus - 06-05-2022, 03:03 PM
RE: Proggies - by bplus - 06-06-2022, 08:04 PM
RE: Proggies - by bplus - 06-07-2022, 02:18 AM
RE: Proggies - by dbox - 03-03-2023, 09:14 PM
RE: Proggies - by bplus - 06-07-2022, 10:51 AM
RE: Proggies - by SierraKen - 06-09-2022, 07:04 PM
RE: Proggies - by bplus - 06-09-2022, 10:40 PM
RE: Proggies - by bplus - 06-22-2022, 02:59 PM
RE: Proggies - by vince - 06-23-2022, 08:04 PM
RE: Proggies - by SierraKen - 06-24-2022, 06:28 PM
RE: Proggies - by bplus - 07-13-2022, 06:19 PM
RE: Proggies - by bplus - 07-17-2022, 11:38 PM
RE: Proggies - by bplus - 07-19-2022, 07:16 PM
RE: Proggies - by vince - 07-22-2022, 10:40 PM
RE: Proggies - by dbox - 07-23-2022, 12:47 AM
RE: Proggies - by SierraKen - 07-23-2022, 05:16 PM
RE: Proggies - by bplus - 07-24-2022, 04:16 PM
RE: Proggies - by dbox - 07-24-2022, 11:33 PM
RE: Proggies - by SierraKen - 07-24-2022, 11:38 PM
RE: Proggies - by bplus - 09-19-2022, 07:16 PM
RE: Proggies - by bplus - 09-20-2022, 03:42 PM
RE: Proggies - by James D Jarvis - 09-21-2022, 12:22 PM
RE: Proggies - by bplus - 09-21-2022, 02:39 PM
RE: Proggies - by mnrvovrfc - 09-24-2022, 03:25 AM
RE: Proggies - by James D Jarvis - 09-21-2022, 02:55 PM
RE: Proggies - by bplus - 09-21-2022, 03:46 PM
RE: Proggies - by James D Jarvis - 09-21-2022, 05:46 PM
RE: Proggies - by bplus - 09-21-2022, 06:29 PM
RE: Proggies - by bplus - 10-09-2022, 08:17 PM
RE: Proggies - by vince - 10-09-2022, 09:20 PM
RE: Proggies - by bplus - 10-10-2022, 01:52 PM
RE: Proggies - by vince - 10-10-2022, 04:20 PM
RE: Proggies - by bplus - 10-18-2022, 02:54 PM
RE: Proggies - by bplus - 01-16-2023, 03:53 PM
RE: Proggies - by bplus - 01-16-2023, 03:59 PM
RE: Proggies - by bplus - 01-16-2023, 04:05 PM
RE: Proggies - by bplus - 01-16-2023, 04:09 PM
RE: Proggies - by bplus - 01-16-2023, 04:13 PM
RE: Proggies - by bplus - 01-17-2023, 08:18 PM
RE: Proggies - by bplus - 03-06-2023, 07:04 PM
RE: Proggies - by bplus - 03-24-2023, 02:41 AM
RE: Proggies - by vince - 03-24-2023, 05:22 AM
RE: Proggies - by bplus - 03-24-2023, 05:32 AM
RE: Proggies - by mnrvovrfc - 03-24-2023, 05:54 AM
RE: Proggies - by vince - 04-09-2023, 06:49 AM
RE: Proggies - by bplus - 04-09-2023, 03:05 PM
RE: Proggies - by bplus - 07-23-2023, 12:16 PM
RE: Proggies - by GareBear - 07-23-2023, 05:47 PM
RE: Proggies - by bplus - 07-23-2023, 07:35 PM
RE: Proggies - by bplus - 07-24-2023, 07:04 PM
RE: Proggies - by bplus - 07-24-2023, 07:09 PM
RE: Proggies - by bplus - 08-17-2023, 07:17 AM
RE: Proggies - by johnno56 - 08-17-2023, 10:32 AM
RE: Proggies - by bplus - 08-28-2023, 03:24 PM
RE: Proggies - by Dav - 08-28-2023, 05:28 PM
RE: Proggies - by PhilOfPerth - 08-28-2023, 11:47 PM
RE: Proggies - by johnno56 - 08-29-2023, 07:11 AM
RE: Proggies - by bplus - 08-29-2023, 12:39 PM
RE: Proggies - by bplus - 09-03-2023, 02:47 PM
RE: Proggies - by vince - 09-03-2023, 11:10 PM
RE: Proggies - by SMcNeill - 09-03-2023, 05:22 PM
RE: Proggies - by bplus - 09-03-2023, 05:41 PM
RE: Proggies - by bplus - 09-03-2023, 05:47 PM
RE: Proggies - by bplus - 09-03-2023, 11:21 PM
RE: Proggies - by Dav - 09-04-2023, 01:00 AM
RE: Proggies - by grymmjack - 09-06-2023, 12:14 AM
RE: Proggies - by bplus - 09-04-2023, 01:45 AM
RE: Proggies - by mrbcx - 09-05-2023, 03:22 AM
RE: Proggies - by bplus - 09-05-2023, 12:35 PM
RE: Proggies - by bplus - 09-08-2023, 10:24 PM
RE: Proggies - by Dav - 09-09-2023, 12:43 AM
RE: Proggies - by bplus - 09-21-2023, 06:42 PM
RE: Proggies - by bplus - 09-27-2023, 03:16 AM
RE: Proggies - by Dav - 10-05-2023, 08:24 PM
RE: Proggies - by bplus - 10-05-2023, 08:49 PM
RE: Proggies - by bplus - 10-08-2023, 02:13 PM
RE: Proggies - by Dav - 10-08-2023, 06:04 PM
RE: Proggies - by Dav - 10-08-2023, 11:56 PM
RE: Proggies - by bplus - 10-09-2023, 12:22 AM
RE: Proggies - by Dav - 10-09-2023, 12:59 AM
RE: Proggies - by PhilOfPerth - 10-09-2023, 05:28 AM
RE: Proggies - by mnrvovrfc - 10-09-2023, 10:58 AM
RE: Proggies - by Dav - 10-09-2023, 12:33 PM
RE: Proggies - by bplus - 10-09-2023, 05:37 PM
RE: Proggies - by Dav - 10-09-2023, 08:56 PM
RE: Proggies - by bplus - 10-09-2023, 09:23 PM
RE: Proggies - by Dav - 10-18-2023, 02:11 PM
RE: Proggies - by bplus - 10-18-2023, 07:40 PM
RE: Proggies - by CharlieJV - 10-19-2023, 02:28 AM
RE: Proggies - by bplus - 10-19-2023, 01:48 PM
RE: Proggies - by dbox - 10-19-2023, 02:16 PM
RE: Proggies - by dbox - 10-19-2023, 04:07 PM
RE: Proggies - by bplus - 10-19-2023, 05:23 PM
RE: Proggies - by bplus - 10-19-2023, 09:32 PM
RE: Proggies - by Dav - 10-19-2023, 11:45 PM
RE: Proggies - by bplus - 10-27-2023, 08:00 AM
RE: Proggies - by vince - 10-27-2023, 08:49 AM
RE: Proggies - by bplus - 10-27-2023, 01:32 PM
RE: Proggies - by GareBear - 10-28-2023, 05:16 PM
RE: Proggies - by bplus - 10-28-2023, 05:29 PM
RE: Proggies - by dbox - 10-28-2023, 10:19 PM
RE: Proggies - by bplus - 10-28-2023, 11:10 PM
RE: Proggies - by bplus - 10-29-2023, 11:03 AM
RE: Proggies - by bplus - 01-06-2024, 03:12 PM
RE: Proggies - by CharlieJV - 01-06-2024, 05:01 PM
RE: Proggies - by bplus - 01-29-2024, 04:30 PM
RE: Proggies - by PhilOfPerth - 01-29-2024, 11:24 PM
RE: Proggies - by bplus - 01-30-2024, 02:52 PM
RE: Proggies - by bplus - 03-17-2024, 07:11 PM
RE: Proggies - by bplus - 03-24-2024, 11:25 PM
RE: Proggies - by vince - 03-25-2024, 12:27 AM
RE: Proggies - by bplus - 03-26-2024, 06:33 PM
RE: Proggies - by bplus - 05-11-2024, 06:13 PM
RE: Proggies - by bplus - 06-14-2024, 01:58 AM
RE: Proggies - by PhilOfPerth - 06-14-2024, 06:01 AM
RE: Proggies - by NakedApe - 06-14-2024, 04:13 AM
RE: Proggies - by vince - 06-14-2024, 09:15 AM
RE: Proggies - by bplus - 06-14-2024, 10:42 PM
RE: Proggies - by Dav - 06-14-2024, 10:58 PM
RE: Proggies - by bplus - 06-19-2024, 10:14 PM
RE: Proggies - by madscijr - 06-20-2024, 12:41 PM
RE: Proggies - by Dav - 06-20-2024, 06:28 PM
RE: Proggies - by bplus - 06-20-2024, 06:45 PM
RE: Proggies - by dbox - 06-20-2024, 06:48 PM
RE: Proggies - by bplus - 06-20-2024, 07:40 PM
RE: Proggies - by bplus - 06-20-2024, 07:46 PM
RE: Proggies - by bplus - 06-27-2024, 01:09 PM
RE: Proggies - by Steffan-68 - 06-27-2024, 04:02 PM
RE: Proggies - by bplus - 06-27-2024, 04:09 PM
RE: Proggies - by Steffan-68 - 06-27-2024, 04:51 PM
RE: Proggies - by GareBear - 06-27-2024, 05:08 PM
RE: Proggies - by Steffan-68 - 06-27-2024, 05:21 PM
RE: Proggies - by bplus - 06-29-2024, 01:39 PM
RE: Proggies - by bplus - 07-01-2024, 11:30 PM
RE: Proggies - by SMcNeill - 07-02-2024, 12:59 AM
RE: Proggies - by bplus - 07-02-2024, 01:53 PM
RE: Proggies - by SMcNeill - 07-02-2024, 03:07 PM
RE: Proggies - by vince - 07-02-2024, 04:15 AM
RE: Proggies - by bplus - 07-02-2024, 02:02 PM
RE: Proggies - by bplus - 07-02-2024, 05:30 PM
RE: Proggies - by SMcNeill - 07-02-2024, 11:11 PM
RE: Proggies - by bplus - 07-02-2024, 11:30 PM
RE: Proggies - by bplus - 07-15-2024, 12:07 AM
RE: Proggies - by vince - 07-17-2024, 02:06 PM
RE: Proggies - by bplus - 07-17-2024, 02:39 PM
RE: Proggies - by vince - 07-17-2024, 03:34 PM
RE: Proggies - by Dav - 08-30-2024, 05:47 PM
RE: Proggies - by bplus - 08-30-2024, 05:57 PM
RE: Proggies - by Dav - 08-30-2024, 06:00 PM
RE: Proggies - by Dav - 10-02-2024, 01:06 PM
RE: Proggies - by bplus - 10-02-2024, 02:59 PM
RE: Proggies - by Dav - 10-02-2024, 04:31 PM
RE: Proggies - by bplus - 10-02-2024, 08:45 PM
RE: Proggies - by Dav - 10-02-2024, 09:05 PM
RE: Proggies - by NakedApe - 10-02-2024, 09:13 PM
RE: Proggies - by Dav - 10-03-2024, 07:31 PM
RE: Proggies - by bplus - 10-03-2024, 10:35 PM
RE: Proggies - by Dav - 10-03-2024, 11:04 PM
RE: Proggies - by madscijr - 10-07-2024, 08:08 PM
RE: Proggies - by bplus - 10-07-2024, 08:37 PM
RE: Proggies - by bplus - 11-01-2024, 09:28 PM
RE: Proggies - by PhilOfPerth - 11-01-2024, 11:04 PM
RE: Proggies - by bplus - 11-01-2024, 11:48 PM
RE: Proggies - by bplus - 11-09-2024, 01:21 AM
RE: Proggies - by PhilOfPerth - 11-09-2024, 07:48 AM
RE: Proggies - by vince - 11-09-2024, 03:38 PM
RE: Proggies - by bplus - 11-09-2024, 03:53 PM
RE: Proggies - by PhilOfPerth - 11-09-2024, 11:06 PM



Users browsing this thread: 11 Guest(s)