Hacker News new | past | comments | ask | show | jobs | submit login
Clifford Attractors (paulbourke.net)
62 points by d00r on Feb 1, 2016 | hide | past | favorite | 16 comments



Julien C. Sprott has a very fun, approachable, and free book on generating various kinds of strange attractor visualizations:

http://sprott.physics.wisc.edu/sa.htm

It has 1993-era code, which paradoxically might make it good for a coding beginner since you'd have to work a bit to figure out a basic syntactic translation, but the high level idea is already there. You get immediate visual results, and there is a lot of room to experiment and play.


I wrote a renderer (eventually became Krakatoa) for these and similar systems developed by "Dr" Baily:

http://www.imagesavant.com/

Was used (and still used) on a bunch of films for Krytonite, dream sequences, plasma, etc. The longest render time I remember for getting rid of noise was over 24Hrs and involved +1B computed samples of the underlying functions.


Wow, these bring back deep memories.

I was basically weaned on a slew of Clifford Pickover's books — first his Black Holes: A Traveller's Guide and later Mazes For The Mind, The Loom Of God, Keys To Infinity, Fractal Horizons and others.

I distinctly remember a vacation spent in Portugal... I can date it to summer 1996 because I remember the TV droning on about the campaign between Bill Clinton and Bon Dole (!) furiously typing in Pickover's BASIC code to QBASIC (or was it GWBASIC?) in DOS mode on my first laptop, a Cyrix 586 ACER thing made of cheap, slightly springy plastic. I was fascinated by those patterns. I remember how at first the code all seemed like incantations but how gradually I got a feel for what the various parts did, and the strange pride when I eventually located (and modified) the parts that actually represented the formula being iterated, which I then proceeded to modify, and I'd sit there staring at the slowly-emerging patterns.

I'd forgotten all that. Thanks for bringing it back.


Neat site.

Someone should make a screensaver like the last two random attractors on: http://paulbourke.net/fractals/lyapunov/

http://paulbourke.net/fractals/lyapunov/explore1.jpg

http://paulbourke.net/fractals/lyapunov/explore2.jpg

Those look badass.


There's a lot of noise in those images. You could reduce that by increasing the sample count significantly, which should be easy on modern GPUs. (I recognize the noise levels because I wrote a renderer for Clifford Attractors circa 2000, but back then, it took all night on a nice Mac G4 to get images with that kind of quality.) Maybe I'll post my OpenGL-based version.


What determines alpha on those images? On any attractors really? You end up with an infinitely large set of points between say -1.5 and 2.0. How does that end up being graphed. Perhaps that is magic/beauty of it.


I've done similar images in the past and the approach I used was:

1) Choose a target image resolution, and set up a square array of that size, initialized to zeroes.

2) Decide on the bounds you want to use, and linearly map coordinates into the target image. Say you want to graph x in the range [Xmin, Xmax) and your resolution is Xres, then pixel_x = (int)((x - Xmin) * Xres / (Xmax - Xmin)) (Note that if you have a higher-dimensional attractor you'll need some form of projection down to two dimensions.)

3) Iterate your attractor equation (starting point doesn't matter because it's an attractor). Each iteration, increment the pixel that matches your current coordinates. Stop iterating when you land on a pixel with a value above some preset.

4) Apply a palette to your pixel values to turn it into a nice picture like the ones linked here.


I think it's determined by resolution and number of iterations.

I wrote a quick JS vesrion using the provided formulas: http://bl.ocks.org/gunn/87401cb547cc2ee5b5ec


Your code and mine look really similar. You did a lot more points than I did. I will try that out and see if makes mine less "pointy." ha


Could you elaborate or suggest any references? It sounds like you are saying something that appears chaotic forms some coherent beautiful image?

I know alpha refers to many things but one of those is the fine-structure constant. There's some remarkable beauty in it because it unites electromagnetism, relativity and quantum mechanics. And this is why many thought the reciprocal of alpha (137) would become as important as 0 and Pi.

I am assuming though none of that relates to fractals and that alpha in this context refers to the angles?


"Alpha" in this context probably refers to opacity, the A in RGBA. GP is making a comment on the apparent translucency of the filaments that comprise the attractor.


Yeah my question really is how do you color these things in the render.

I quickly wrote something that would output the numbers and mapped those to points on the screen. But it just ended up looking like that. Points on a screen.

The images on the site looked like they had alpha... or used a much better idea than mine of just using points on a plane.


I loved Clifford pick over's books as a teenager. Implemented a lot of his ideas as graphics effects on a 486. They're still fresh.

Computers, Pattern, Chaos and Beauty in particular was good, and cover attractors quite a bit.

His website is a monster of 1990's kitsch - Over 50 books. http://www.pickover.com


Imma let you finish, but the Lorenz attractor is the best strange attractor of all time.

https://en.wikipedia.org/wiki/Lorenz_system


I spent some time rendering these sorts of attractors back between 1995 and 2004, influenced by Pickover and Sprott...

http://technocosm.org/chaos/gallery.html

Pardon me for not updating the site to modern standards, the html is very late 90s.


Here's a quick JS implementation: https://jsfiddle.net/7hx2mq03/




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: