Before I get too far into the details, let me do you a quick favor and recommend you read at least one of his (currently) 45+ published books. If you are any kind of geek at all, you will find an enjoyable read. Calculus and Pizza is my favorite so far.
Right… so Chaos in Wonderland is a tough book to pin down, and I’ll save you my drivel over what makes it so fantastic. However, the book contains a lot of very cool pictures that look something like these:
I thought these pictures were great. Furthermore, I could tell immediately they were made on a computer. I had grown up banging out crude BASIC games on a Commodore 64, and was now equipped with a Pentium and VB4. I thought for sure I could make some cool pictures of my own. Being abysmal at drawing (that’s “drawring” if you’re from Texas) I liked the idea that I could, finally, make art.
I kept reading, and finally came across the following:
x = 0.1; y = 0.1; /* starting point */
DO 10 Million Times
xnew = sin(y*b) + c*sin(x*b);
ynew = sin(x*a) + d*sin(y*a);
x = xnew; y = ynew; PlotDotAt(x, y);
Being an over-enthusiastic kid, I dropped the book, ran to my PC, and neglected to learn anything else about these images for a long time.
I did get a simple program working though. Since I had no idea how to manipulate images or even what transparency was, I wound up with images that looked more like the one to the right. I was starting with a white background, and putting black dots on it. I eventually figured out how to sample a pixel before I put down my dot, and increment the RGB values of the pixel by one. This let me get 256 levels of gray, which was awesome. This was before the internet, so I had to use a book to figure out how to read those values and update them. Ahh, the good old days.
One property of these images is that the further you zoom in on on, the more detail you see. For example, the image to the left is a zoom in on the center of the fourth image from the Fractal Dreams gallery at the top of this post. I found that, much like fractals, the more detail you zoom in to see, the more fascinating the image becomes. I started looking for ways to render these in large enough sizes that they would print out and really be impressive. In 1993 working on my Pentium, I was out of luck. I wanted to do images that were 600x600 DPI and 3x3 feet in size. I needed to allocate an image in memory that was 21,600x21,600 pixels, and plot a total of 8,999,999,424 dots on it. Not only did my machine not have nearly enough memory to hold that image, plotting that many dots would have taken long enough that I would have needed my computer for something else long before it finished. I don’t remember if it was weeks or just days to run that many iterations in serial, but it was too long.
I forgot about the project for a long time, lost the source code and the book, and was stuck when I wanted to try again. I don’t remember how, but I eventually remembered the title, bought it on Amazon, and got going again. I finally did get some of those really large images rendered, but it still takes hours and hours to do it. I’ve been playing with solutions for scaling the processing of these images, and we’ll get into some of the more technical details in my next post. In the meantime, here is a render of one of the simpler images I have done: