Proggies
#64
(09-24-2022, 03:25 AM)mnrvovrfc Wrote:
(09-21-2022, 02:39 PM)bplus Wrote: Thanks to James D Jarvis, your poly solids gave me idea for improvement to "Even Better Stars"

Even More Better Stars
I can't stand screensavers on Linux, but in case I should need one, this one gets the nod. Only I wish Linux could be like WindowsXP, just rename an EXE file so the OS is convinced it's a screensaver... or a bit more involved. Nice work you two!

Screen savers are Art in Motion (usually animated).

Anyway, I was reloading lost files in JB not backed up when I lost drives again! So I am going through JB forum collecting my little gems and ran across the swizzle series that you folks might like:

Swizzle Series

Code: (Select All)
_Title "Swizzle" ' b+ 2021-05-29
Const Xmax = 600, Ymax = 600, cxy = 300, Pi = _Pi
Screen _NewImage(Xmax, Ymax, 32)
_Delay .25
_ScreenMove _Middle
Dim vScreenR(Xmax, Ymax), vScreenG(Xmax, Ymax), vScreenB(Xmax, Ymax)
restart:
r = Rnd * Rnd: g = Rnd * Rnd: b = Rnd * Rnd
For x = 0 To Xmax
    Line (x, 0)-(x, Ymax), _RGB32(128 + 128 * Sin(r * x), 128 + 128 * Sin(g * x), 128 + 128 * Sin(b * x))
    For y = 0 To Ymax
        vScreenR(x, y) = 128 + 128 * Sin(r * x)
        vScreenG(x, y) = 128 + 128 * Sin(g * x)
        vScreenB(x, y) = 128 + 128 * Sin(b * x)
    Next
Next
swizzle = Rnd * .5 + .8
_Title "Swizzle @" + _Trim$(Str$(swizzle))
For radius = 1 To 200
    For a = 0 To 2 * Pi Step 1 / (2 * Pi * radius)
        x = Int(cxy + radius * Cos(a))
        y = Int(cxy + radius * Sin(a))
        r = vScreenR(x, y)
        g = vScreenG(x, y)
        b = vScreenB(x, y)
        PSet (cxy + radius * Cos(a + radius ^ swizzle * Pi / 180), cxy + radius * Sin(a + radius ^ swizzle * Pi / 180)), _RGB32(r, g, b)
    Next
Next
_Delay 3
GoTo restart


Code: (Select All)
_Title "Swizzle 2" ' b+ 2021-05-30  Make use of 2D Arrays
Const Xmax = 600, Ymax = 600, cxy = 300, Pi = _Pi
Screen _NewImage(Xmax, Ymax, 32)
_Delay .25
_ScreenMove _Middle
Dim vScreenR(Xmax, Ymax), vScreenG(Xmax, Ymax), vScreenB(Xmax, Ymax)
restart:
r = Rnd * Rnd * .25: g = Rnd * Rnd * .25: b = Rnd * Rnd * .25
For x = 0 To .5 * Xmax
    Line (x, x)-(Xmax - x, Ymax - x), _RGB32(128 + 128 * Sin(r * x), 128 + 128 * Sin(g * x), 128 + 128 * Sin(b * x)), B
    For y = x To Ymax - x
        vScreenR(x, y) = 128 + 128 * Sin(r * x)
        vScreenG(x, y) = 128 + 128 * Sin(g * x)
        vScreenB(x, y) = 128 + 128 * Sin(b * x)
        vScreenR(Xmax - x, y) = 128 + 128 * Sin(r * x)
        vScreenG(Xmax - x, y) = 128 + 128 * Sin(g * x)
        vScreenB(Xmax - x, y) = 128 + 128 * Sin(b * x)
    Next
    For y = x To Xmax - x
        vScreenR(y, x) = 128 + 128 * Sin(r * x)
        vScreenG(y, x) = 128 + 128 * Sin(g * x)
        vScreenB(y, x) = 128 + 128 * Sin(b * x)
        vScreenR(Xmax - y, Ymax - x) = 128 + 128 * Sin(r * x)
        vScreenG(Xmax - y, Ymax - x) = 128 + 128 * Sin(g * x)
        vScreenB(Xmax - y, Ymax - x) = 128 + 128 * Sin(b * x)
    Next
Next
_Delay 1
swizzle = Rnd * .2 + .9
_Title "Swizzle @" + _Trim$(Str$(swizzle))
For radius = 1 To 300
    For a = 0 To 2 * Pi Step 1 / (2 * Pi * radius)
        x = Int(cxy + radius * Cos(a))
        y = Int(cxy + radius * Sin(a))
        r = vScreenR(x, y)
        g = vScreenG(x, y)
        b = vScreenB(x, y)
        PSet (cxy + radius * Cos(a + radius ^ swizzle * Pi / 180), cxy + radius * Sin(a + radius ^ swizzle * Pi / 180)), _RGB32(r, g, b)
    Next
Next
_Delay 3
GoTo restart


Code: (Select All)
_Title "Swizzle YY" ' b+ 2021-05-29
Const Xmax = 600, Ymax = 600, cxy = 300, Pi = _Pi
Screen _NewImage(Xmax, Ymax, 32)
_Delay .25
_ScreenMove _Middle
Dim vScreenR(Xmax, Ymax), vScreenG(Xmax, Ymax), vScreenB(Xmax, Ymax)

For x = 0 To Xmax
    If x < (.5 * Xmax) Then
        r = 0: g = 0: b = 0
    Else
        r = 255: g = 255: b = 255
    End If
    Line (x, 0)-(x, Ymax), _RGB32(r, g, b)
    For y = 0 To Ymax
        vScreenR(x, y) = r
        vScreenG(x, y) = g
        vScreenB(x, y) = b
    Next
Next
swizzle = 1.
_Title "Swizzle @" + _Trim$(Str$(swizzle))
For radius = 1 To 180
    For a = 0 To 2 * Pi Step 1 / (2 * Pi * radius)
        x = Int(cxy + radius * Cos(a))
        y = Int(cxy + radius * Sin(a))
        r = vScreenR(x, y)
        g = vScreenG(x, y)
        b = vScreenB(x, y)
        PSet (cxy + radius * Cos(a + radius ^ swizzle * Pi / 180), cxy + radius * Sin(a + radius ^ swizzle * Pi / 180)), _RGB32(r, g, b)
    Next
Next

Code: (Select All)
_Title "Swizzle Spin" ' b+ 2021-05-29
Const Xmax = 600, Ymax = 600, cxy = 300, Pi = _Pi
Screen _NewImage(Xmax, Ymax, 32)
_Delay .25
_ScreenMove _Middle
Randomize Timer
Dim vScreenR(Xmax, Ymax), vScreenG(Xmax, Ymax), vScreenB(Xmax, Ymax)
restart:
r = Rnd * Rnd: g = Rnd * Rnd: b = Rnd * Rnd
For x = 0 To Xmax
    Line (x, 0)-(x, Ymax), _RGB32(128 + 128 * Sin(r * x), 128 + 128 * Sin(g * x), 128 + 128 * Sin(b * x))
    For y = 0 To Ymax
        vScreenR(x, y) = 128 + 128 * Sin(r * x)
        vScreenG(x, y) = 128 + 128 * Sin(g * x)
        vScreenB(x, y) = 128 + 128 * Sin(b * x)
    Next
Next
swizzle = Rnd * .5 + .8

For radius = 1 To 200
    For a = 0 To 2 * Pi Step 1 / (2 * Pi * radius)
        x = Int(cxy + radius * Cos(a))
        y = Int(cxy + radius * Sin(a))
        r = vScreenR(x, y)
        g = vScreenG(x, y)
        b = vScreenB(x, y)
        PSet (cxy + radius * Cos(a + radius ^ swizzle * Pi / 180), cxy + radius * Sin(a + radius ^ swizzle * Pi / 180)), _RGB32(r, g, b)
    Next
Next
s& = _NewImage(Xmax * 2.2, Ymax * 2.2, 32)
_PutImage , 0, s&
Do
    RotoZoom cxy, cxy, s&, 1, a
    a = a - 3: If a < -360 Then a = 0: _FreeImage s&: GoTo restart
    _Display: _Limit 30
Loop Until InKey$ <> ""


Sub RotoZoom (X As Long, Y As Long, Image As Long, Scale As Single, Rotation As Single)
    Dim px(3) As Single: Dim py(3) As Single
    W& = _Width(Image&): H& = _Height(Image&)
    px(0) = -W& / 2: py(0) = -H& / 2: px(1) = -W& / 2: py(1) = H& / 2
    px(2) = W& / 2: py(2) = H& / 2: px(3) = W& / 2: py(3) = -H& / 2
    sinr! = Sin(-Rotation / 57.2957795131): cosr! = Cos(-Rotation / 57.2957795131)
    For i& = 0 To 3
        x2& = (px(i&) * cosr! + sinr! * py(i&)) * Scale + X: y2& = (py(i&) * cosr! - px(i&) * sinr!) * Scale + Y
        px(i&) = x2&: py(i&) = y2&
    Next
    _MapTriangle _Seamless(0, 0)-(0, H& - 1)-(W& - 1, H& - 1), Image& To(px(0), py(0))-(px(1), py(1))-(px(2), py(2))
    _MapTriangle _Seamless(0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), Image& To(px(0), py(0))-(px(3), py(3))-(px(2), py(2))
End Sub


   
b = b + ...
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



Users browsing this thread: 42 Guest(s)