Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Draw pixel and alpha channel
#9
i have this version with little bit different colors

Code:
' Bubble universe
' ---------------
' Paul Dunn posted this code but for SpecBAS in a facebook group. It looked so cool that I had to
' rewrite it in n7.

constant TAU = 6.283185307179586

set window "Bubble universe", 512, 512
set redraw off

n = 200; r = TAU/235
x = 0; y = 0;
v = 0; t = 0;
hw = width(primary)/2; hh = height(primary)/2

while not keydown(KEY_ESCAPE)
    set color 0, 0, 0
    cls
    for i = 0 to n  for j = 0 to n
        u = sin(i + v) + sin(r*i + x)
        v = cos(i + v) + cos(r*i + x)
        x = u + t
        set color i, j, 99
        set pixel hw + u*hw*0.4, hh + v*hh*0.4
    next
    t = t + 0.025
   
    set caret hw, 4
    set color 255, 255, 255
    center "Press esc to exit ..."
   
    fwait 60
    redraw
wend
Reply


Messages In This Thread
Draw pixel and alpha channel - by Tomaaz - 02-07-2024, 05:50 PM
RE: Draw pixel and alpha channel - by johnno56 - 02-07-2024, 06:04 PM
RE: Draw pixel and alpha channel - by Tomaaz - 02-07-2024, 06:11 PM
RE: Draw pixel and alpha channel - by johnno56 - 02-07-2024, 10:37 PM
RE: Draw pixel and alpha channel - by 1micha.elok - 02-07-2024, 11:21 PM
RE: Draw pixel and alpha channel - by Marcus - 02-08-2024, 02:33 PM
RE: Draw pixel and alpha channel - by Marcus - 02-08-2024, 03:22 PM
RE: Draw pixel and alpha channel - by Tomaaz - 02-08-2024, 04:04 PM
RE: Draw pixel and alpha channel - by aurel - 02-08-2024, 07:59 PM
RE: Draw pixel and alpha channel - by johnno56 - 02-09-2024, 04:26 AM
RE: Draw pixel and alpha channel - by Tomaaz - 02-09-2024, 01:14 PM
RE: Draw pixel and alpha channel - by Marcus - 02-09-2024, 03:51 PM
RE: Draw pixel and alpha channel - by Tomaaz - 02-09-2024, 05:11 PM
RE: Draw pixel and alpha channel - by johnno56 - 02-09-2024, 09:17 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)