This snippet will fill the screen with a swirl of colors
It's pretty slow. I'm going to look into putting it in a shader so it can be dynamic
Here it is. Make sure you set the first line to your resolution
set display mode 1440,900,32 `set this to your resolution
Randomize Timer()
sync on : sync rate 30
n=make vector2(1)
dist as float
r as float
p1 as float
p2 as float
p3 as float
v as float = .75 `making this number bigger makes more layers
s as float = 1.0 `amount of swirl!!!
global SW : SW = screen width()
SH = screen height()
SWD2 = screen width() / 2
SHD2 = screen Height() / 2
global ptr as dword
global pitch
lock pixels
ptr = get pixels pointer()
pitch = get pixels pitch()/4
unlock pixels
global ptr2 as dword
d as double integer
color_ as dword
do
p1 = (rnd(1000)+500) / 1000.0 `make three .5 to 1.5 decimals
p2 = (rnd(1000)+500) / 1000.0
p3 = (rnd(1000)+500) / 1000.0
for y = 0 to SH-1
For x = 0 to SW - 1
dist = range2d(SWD2,SHD2,x,y)
ang = GetAngle(SWD2,SHD2,x,y)+(dist*s)
r = dist*abs(sin(ang)*v)
ptr2 = ptr+(((y*pitch)+x)*4)
*ptr2 = RGB(p1*r mod 256,p2*r mod 256,p3*r mod 256)
`Dot_(x,y,RGB(p1*r mod 256,p2*r mod 256,p3*r mod 256))
Next x
next y
sync
loop
function range2D(x1#,y1#,x2#,y2#)
set vector2 1,x1#-x2#,y1#-y2# : result#=length vector2(1)
endfunction result#
function GetAngle(x1#,y1#,x2#,y2#)
RV# = atanfull(x2#-x1#,y2#-y1#)
endfunction RV#
`function dot_(xp,yp,color as dword)
` ptr2 = ptr+(((yp*pitch)+xp)*4)
` *ptr2 = color
`endfunction