### On 4D Fractals...

Inspired by the gorgeous Buddhabrot, I’ve been playing with my own fractals. I was curious what would happen to the standard Mandelbrot equation when extended to include hypercomplex numbers. If anyone familiar with this stuff would care to tell me whether this is actually valid math, I’d be grateful. In the meantime, it produces some fairly pretty results, so I’m keeping it :)

The 2D Buddhabrot is pretty straightforward to implement. You can get some really nice ghostly effects if you separate the RGB layers and render them with different parameters (right).

There’s also a nice sense of anticipation as repeated iterations continue to refine the image and produce something beautiful out of the random noise. Admittedly this anticipation was lost somewhat when I managed to speed up the program about 1000x from its original speed…

### 4D renderings

So anyway, replacing the 2 dimensional Mandelbrot’s complex z value with a hypercomplex one gives us a whopping 4 dimensions to play with. I’m then taking a 3D slice of the 4D fractal, and displaying it in OpenGL. First attempt used clouds of GL_POINTS…results were reasonably pretty, but slow as hell. My ‘slice’ is a 3D cube (512×512x512) with over 130 million points to render….needless to say, it’s a little slow.

(*It’s really difficult to get an idea of what these look like from a 2D screenshot. I’ll try and get some movies of them rotating if I get chance.*)

So my next attempt used 3D textures. Surprisingly easy to implement, and they’re reasonably fast. However, you lose a lot of the sharpness that the points represention gives you…things are basically constrained by the available memory on my poor Radeon 9700. A color texture 512×512x512 would take up 384MB of texture memory. Texture compression goes some way to alleviating this, but I seem to be maxing out at 256×256x256.

Anyway, the results. The k=0 slice is the most recognisable from its original Mandelbrot source – ignore the diagonal points and you’ve got the standard blob around the centre with its head to the left.

The diagonal spikes have some interesting features using the buddhabrot representation. They have fishbone ‘ribs’ curving out of them. I’ll try and get some better shots of them later – they get lost in the low resolution of the 3D rendering.

I’ll update this page as I go along with some more interesting slices of the 4D space.

I’m getting a little frustrated by hardware limitations…currently thinking of writing my own software renderer for this and running it all in offline mode. We’ll see.

Commenting is closed for this article.

Keep up the creativity! — matthew Nov 23, 07:39 PM #

really nice work here. i remember doing some computer plots of complex curves mapped from 4d to 3d and loved the results. keep it up.

— Tristan Perich May 29, 11:07 AM #