Hello 3rd Dimension

May 29, 2013

Further to my last post ‘Distance Fractals’, I thought I’d write a bit more on it, as it seems to be my new direction.

I’m now back living in Belfast, Ireland, after living in New York for 9 months.  I tried to ‘make it’ there, but in the end, was to commercial and competitive a place for the likes of me.  I need to do what ‘I’ want to do.  It’s what I’m best at.  I tried to help a friend set up an Interactive Studio there.  But I had to compromise with what I wanted, and with what clients wanted.  The two don’t coexist.

Since moving back, I’ve been applying for film funding and arts funding for my own ideas.  I feel inspired and confident again, and will hopefully being starting up a studio here.  More to follow..


I’ve always wondered how I could create generative and algorithmic art in 3D, rather than just in ‘flat’ 2D, as with all my works such as Eyegasm, Zio, Nest That Sailed the Sky etc etc.

Do I create some nice random meshes in Processing – and then import to some 3d software for final rendering?

I never felt comfortable doing code art in 3D – real time OpenGL is too ‘tech demo-ey” and exporting to a 3D package doesn’t make it code art anymore.

Then one day I discovered Distance Fractals, and Ray Marching.

Ray Marching, put brutally simply, is creating shape and form in 3D without creating geometry, but by writing an algorithm, or function, that defines every point in space as being either a surface, or empty space.  Ray Marching, approximates this into a 3d scene quickly by ‘Distance Estimation’ – with complex lighting, reflections, shadows, glows and fog and not too much extra CPU overhead.

Perfect.  I can now play with code and functions, and see the final final result when I run the program..

Ray Marching isn’t something that new – and I’m a little late to the party maybe, but the thing is it’s only a small party that not many people know about.

So what happens when you throw that most beautiful and complex of mathematical functions, the 3d fractal, into a Ray Marcher ?

You get this.  Thanks to Edward Porten on Open Processing.

This man is a genius.  Thank you.

I now have code in front me to explore creating 3d animation and worlds out of algorithms, that render beautifully, in almost in real time, that I can interact and move around in.

It’s the ultimate sandbox.


Screen Shot 2013-05-25 at 5.29.55 PM

This is a Menger sponge.  A primitive iterative fractal.

Here’s the code.

float map(PVector z0)

float r = length(z0);
float t = 0.0;
int i = 0;
float ss=1.;
for (i=0;i<iterations && r<60.0;i++) {

z0.x=abs( z0.x);
z0.y=abs( z0.y);
z0.z=abs( z0.z);
if ( z0.x- z0.y<0.0) {
t= z0.y;
z0.y= z0.x;
if ( z0.x- z0.z<0) {
t= z0.z;
z0.z= z0.x;
if ( z0.y- z0.z<0.0) {
t= z0.z;
z0.z= z0.y;

z0.x=scale* z0.x-CX*(scale-1.0);

z0.y=scale* z0.y-CY*(scale-1.0);

z0.z=scale* z0.z;
if ( z0.z>0.5*CZ*(scale-1.0)) z0.z-=CZ*(scale-1.0);

r=max(z0.x-1, max(z0.y-1, z0.z-1));
return r*ss;//the estimated distance


A Menger fractal is Nothing special, but what happens when you experiment with small, random transformations and rotations in your code?  You get this..


mmm much more interesting.  You then take it further with more mutations…

You could now be looking at a natural form from the real world – because of the random mutations in a simple geometric formula.

A principle of evolution, as I understand it, is genetic mutation.  The DNA of the offspring of every 2 parent species will be slightly different, because of random mutation, allowing for the variety and diversity of life to evolve.  And to the best of my knowledge, these mutations in DNA are caused by the background radiation of the universe, i.e. the field of energy remaining from the ‘big bang’..

This I love.  The example above unifies all of creation in numbers and code, which seems to motivate me most as an artist.  The forms of nature, at their heart, are simple algorithms and geometeric relationships, made complex and beautiful by iterative mutations.

A final big thank you to all the people who are developing and inspiring this kind of work – Syntopia, Knighty, Iñigo Quílez, and everyone on the Fractal Forums.

It’s times like this I want a T-Shirt that says ‘I F**king Love Computers’.




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: