Welcome to Fractal Forums

Fractal Art => Images Showcase (Rate My Fractal) => Topic started by: TruthSerum on May 25, 2015, 10:06:20 AM




Title: Sphereflake
Post by: TruthSerum on May 25, 2015, 10:06:20 AM
This sphereflake was formed by recursively duplicating spheres along the principle axis (http://www.fractalforums.com/programming/branchless-maximumprinciple-axis/) of a point on the surface. In this way, points on the surface are divided into sets associated with an axis vector.

This is just a screenshot of ShaderToy. It looks much better in motion: https://www.shadertoy.com/view/Xlj3DK

(http://i.imgur.com/jWuTscA.png)


Title: Re: Sphereflake
Post by: TruthSerum on May 25, 2015, 10:12:33 AM
Here's what it looks like when the spheres are replaced by cubes:

(http://i.imgur.com/BTgrw9X.png)


Title: Re: Sphereflake
Post by: flexiverse on May 26, 2015, 03:24:13 AM
Very interesting thanks !


Title: Re: Sphereflake
Post by: eiffie on May 26, 2015, 04:53:53 PM
I like the way you are constructing the fractal directly - it is easier to understand - but typically since the code becomes simpler we would write the map loop like this:
Code:
        float fd=(length(p)-1.0)/bs; //divide the result by how much we have scaled up p
        p=abs(p);
        if(p.x<p.y)p.xy=p.yx;//sorting the longest dim into x
        if(p.y<p.z)p.yz=p.zy;
        if(p.x<p.y)p.xy=p.yx;
        p.xy-=1.0; //move xy back towards origin 0.92 makes them just touch
        p*=3.3333; //scale up - makes the result smaller
        bs*=3.3333; //bs is now keeping track of the running scale
        
        if (fd < d) {
            d = fd;
            r = float(i)/3.0;
        }

edit: corrected the offset - my bad