Nova Attractor?

Share your advanced PureBasic knowledge/code with the community.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Maybe you found some sort of singularity, maybe already knowed, but the only thing I can say is : *It's really amazing!* :shock:
I didn't know how to use the zoom, but now... How beautiful!
I'll post this effect on french forum to see reacts :)
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

The effect is really the result of dividing the new location by the constant ef and 1 over the sqr of the distance to the decay speed.

If you divide px and py by mx. You will see the shape of the function and if you look hard enough you'll see the man in the moon at the 45 degrees
you'll need to bump the gain though in the accum array up to ~1.6

Code: Select all

  

    dx = ox - stars()\x 
    dy = oy - stars()\y
    dz = Sqr(dx*dx+dy*dy)
    mx = stars()\speed * dz
    px = Int(scx + (Sin(dx) + Cos(dy)) * mx)
    py = Int(scy + (Cos(dx) - Sin(dy)) * mx)
    stars()\x + (px/mx) 
    stars()\y + (py/mx)  
    stars()\speed + 1/Sqr(dx*dx+dy*dy) 

User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

It was a good idea, after n iterations I doubt it's predictable! There's not even a little symmetry :)
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

No it's not symmetric but using mx seems to show the unattenuated function regardless of where you click on the screen to reseed.
I guess the proof would be to remove the list and seed it with an a single x and y val and iterate that. I had a go but had to zoom in for ages.
I've managed to spend the whole day playing with it and it's still weird. It can produce all sorts of effects.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

updated code 1st post
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

updated added FFT to visualize to sound

compiled version only sorry - as it's littered with comments!
Set Record to WaveOut mix and adjust level to suit
Will add code to do it automatically later.

www.idlearts.com/nova.exe
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

:)
Here what I do to have nice results!
1. R to see much
2. Click on the lower right corner, wait a second
3. P to pause
4. Up and down to find how is made the universe :)
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

We just have a wonderful moment listening to Bach on Muscime (http://www.musicme.com/#/Jean-Sebastien ... 70420.html#), with your program as spectrum analyser, one of the best I've seen!
Thank you again :)
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

I tweeked it a bit more for visualization and added a delay so it's not using all the cpu, though it's still using way to much, the colors won't over saturate as much now, though it's only a quick fix.
I'll probably have some time to give it a good reaming (clean) later next week, I suspect the most cycles are spent getting the surface as opposed to setting the pixels. Can't see any other thing that would account for it.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

updated Visuals adding PI and Echo.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

I think that it you can see more of the curves by extending the original random values... I tried a simple linear value

Code: Select all

    ForEach stars()
      stars()\x = u
      stars()\y = u
      stars()\color = stars()\color = RGB(Random(190)+64,62,0)
      stars()\speed = 1/Sqr(stars()\x*stars()\x + stars()\y*stars()\y)
      u+1
    Next
it's nice :)
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

The values should really be the screen diagonal I guess.
Haven't had a chance to do anymore with it, been shifting house.
Anyway I'm happy enough with what it's doing but will probably look at it more later in the week.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

Updated exe few more modes and bit a better attenuation with FFT.
If you have waveout mix and XP it should select it automatically.

http://www.idlearts.com/nova.exe
Post Reply