Post by tsh73 on Feb 23, 2024 10:08:54 GMT
I dunno
It started from the idea of creating a dot and increase radius from center
Like, how many will be fast enough
Then it turned out to be spiral
Then it turned out to be rotating spiral
Then it picked up color
EDIT
try to change
to
It started from the idea of creating a dot and increase radius from center
Like, how many will be fast enough
Then it turned out to be spiral
Then it turned out to be rotating spiral
Then it picked up color
EDIT
try to change
#gr "circlefilled 10"
to
#gr "circlefilled ";2+r/cx*10
nomainwin
global QuitRequested
open "emitting color circles" for graphics_nsb_nf as #gr
#gr "home; down; posxy cx cy"
#gr "trapclose [quit]"
N=40 'looks OK for my (slow) machine. Try to change
pi=acs(-1)
#gr "color white"
#gr "backcolor red"
while 1
for i = 1 to N
SCAN
a=3*2*pi*i/N
r=i/N*cx*1.2
x=r*cos(a+a0)
y=r*sin(a+a0)
#gr "place ";cx+x;" ";cy+y
#gr "backcolor ";rainbow$(((a+a0) mod pi) / pi)
#gr "circlefilled 10"
next
a0=a0-3*2*pi/N
call pause 30
if QuitRequested then [quit]
#gr "cls"
wend
wait
[quit]
timer 0
close #gr
end
sub pause mil 'now after pause you can check if QuitRequested
t=time$("ms")
while time$("ms")<t+mil
scan
wend
exit sub
[quit]
QuitRequested=1
end sub
function rainbow$(x)
hi = int((x*6) mod 6)+ 5*(x<0) 'fixed to 0..5
f = (x*6) mod 1 + (x<0) 'frac, 0..1
q = (1-f)
select case hi
case 0
r = 1: g = f: b = 0
case 1
r = q: g = 1: b = 0
case 2
r = 0: g = 1: b = f
case 3
r = 0: g = q: b = 1
case 4
r = f: g = 0: b = 1
case 5
r = 1: g = 0: b = q
end select
R = int(r*255)
G = int(g*255)
B = int(b*255)
rainbow$= R;" ";G;" ";B
end function