3D Fractals (Ray-traced with Flash)

// February 8th, 2010 // Experiments, Flash 3D, Generative art, Source code & tutorials

I guess every developer has to play with fractals sooner or later. Now it was my turn.

I didn’t feel much for creating an other flat Mandelbrot set. So I decided to make it a little more challenging for myself and try something in 3D.

fractal AS3

There are already  many amazing renders out there. But instead of copy/pasting formulas, I tried to find my own. And to my surprise, I found some very strange and interesting stuff, especially if you consider they are just mathematical defined volumes.

To render those volumes I made a very simple (and very slow) ray-tracer which follows the ray and start checking points to see if they are in the fractal. A normal ray tracer would just calculate the intersection of the ray and the volume, but I don’t know if that is even possible with this kind of stuff?

If I found a point, I looked near that point for 2 other points so I could calculate the normal and ‘setPixel’ a normal map of the volume.

fractal AS3

» a live example (low quality)

After that, I used a Pixel Bender filter (from Stok3D by David Lenaerts) to add phong shading to the renders.

Some of the renders (click to enlarge):

WiiFlash1 WiiFlash1
WiiFlash1 WiiFlash1

I found a lot of these things and I should have made more images,  but it takes many hours to render them in a high quality. I guess I really should start learning C++…

I included the source code so you can start looking yourself for those amazing volumes out there. If you find something cool, let me know :)
source code: fractal_raytracer_src

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

8 Responses to “3D Fractals (Ray-traced with Flash)”

  1. Rackdoll says:

    C++ is indeed a good option but why not try HLSL ? :)

  2. kris says:

    I rather go for OpenGL-C++ combo, I think that leaves more doors open at the moment. Thanks for the tip :)

  3. George Profenza says:

    Nice ! For some reason I find a slight resemblance to some 2d shapes on the cs3 packaging. Really cool shapes!

  4. Mark says:

    Wow. this is awesome! Very nice. I mostly dislike mandelbrots, most of them have ugly shapes+colors, but I really like this kind of 3d mandelbrots with nice colorings. It almost looks like stills of splashing fluid. Can you make an animation of these things too?

  5. kris says:

    Yes you can animate them.
    They sometimes transform really cool if you change the parameters in tiny steps + you can move your camera position, it is real 3D.

    But its gonna take a long time to render them (some of the renders above took more then 12 hours to complete).

  6. cornedor says:

    i think even with c++ (Alchemy?) it should be too slow for animation, but you it looks realy nice.

  7. subblue says:

    Welcome to the world of 3D fractals and raytracing, it can become quite addictive :)

  8. DrGreen says:

    Adaptive sampling should be much faster…