Welcome to Fractal Forums

Fractal Software => 3D Fractal Generation => Topic started by: GliderKite on November 10, 2010, 04:27:34 PM




Title: Mandelbulb complete formula
Post by: GliderKite on November 10, 2010, 04:27:34 PM
Hello, I'm an Italian boy particularly interested in the generation of fractals.
I created my own software to generate fractals as Mandelbrot, Julia in 2D and now I wanted to deal with ensembles such as Mandelbulb in 3D.

But I met some problems in the implementation of the formula.
Can someone help me telling me what is the complete formula for the standard Mandelbulb?

I already know what we are talking about here: http://en.wikipedia.org/wiki/Mandelbulb (http://en.wikipedia.org/wiki/Mandelbulb). But do not talk about how to change the implementation of the Mandelbrot set in Mandelbulb.

Help me please.

Thanks..


Title: Re: Mandelbulb complete formula
Post by: cKleinhuis on November 10, 2010, 05:31:45 PM
hello and welcome to the forums, check this thread ( first 2 posts )
http://www.fractalforums.com/theory/triplex-algebra/


Title: Re: Mandelbulb complete formula
Post by: GliderKite on November 10, 2010, 05:53:58 PM
hello and welcome to the forums, check this thread ( first 2 posts )
http://www.fractalforums.com/theory/triplex-algebra/

Thanks, but how to use the "triplex" returned by "TriplexRoot"?

Let me explain.
The steps to implement the algorithm of Mandelbrot are:

1) Suppose we consider a small portion around the origin of a complex plane interval (-2, -2) - (2, 2).
2) Replaces, for each point considered, the corresponding coordinates to the complex known term c, the equation Z = z^2 + c, with initial z = 0 + 0i.
3) Calculate the value of Z.
4) If you find that the distance from the origin of Z is greater than two, jump to step 6. To calculate this distance, we take the Pythagorean theorem as follows: given Z = a + bi, the square of the distance d from the origin will be d^2 = a^2 + b^2.
5) If not, it increments a counter and a return to step 3 if the counter has a value less than the predetermined maximum number of iterations, after giving z = Z.
6) It colors the point of a different color depending on the value of the counter.
7) Resets the counter and return to step 2, to calculate the color of the next point.
8-) The process will end when all the issues involved have been prosecuted in that way.


Now, what are the steps to generate the Mandelbulb set?
In addition, the formulas to be used to generate the set are all in your link?


Thanks.







Title: Re: Mandelbulb complete formula
Post by: GliderKite on November 11, 2010, 12:05:57 PM
No one knows how to solve the problem?


Title: Re: Mandelbulb complete formula
Post by: cKleinhuis on November 11, 2010, 12:46:39 PM
the triplex is used as the "Z" value, and you use a box to calculate on (-2,-2,-2) - ( 2,2,2)
the equation z^2+c can be calculated for 3 value based numbers, using triplex math, adding is easy, just add componentwise, for squaring use the triplex squaring method
then you have a field of inside/outside pixels, in 3d it is hard to visualise, because plain dot clouds are of bad quality, the method
used for rendering it is via ray marching, kind of raytracing, where you shoot rays in the room, and check for collision with the surface of the fractal ( inside/outside change )



Title: Re: Mandelbulb complete formula
Post by: GliderKite on November 11, 2010, 01:43:50 PM
May you write as I did at least the step to the set of Mandelbulb?

Then I will ask for formulas, because without a scheme I can not go on ...


Title: Re: Mandelbulb complete formula
Post by: GliderKite on November 13, 2010, 01:10:33 AM
Vorrei ringraziare il tenero gigione per l'esauriente risposta.

There's somebody who understood my question?  :)


Title: Re: Mandelbulb complete formula
Post by: twinbee on November 13, 2010, 12:04:16 PM
Here's a function (cosine version I think) I have as spare which calculates the complete formula. It's very unoptimized though!

The function takes an x, y and z, and then calculates whether that point is part of the set.

Code:
bool MandelbulbFULL(double x, double y, double z) {
double power=8; // Adjustable
double iterations=5; // Adjustable

double newx; double newy; double newz;
newx=x;newy=y;newz=z;
double flag=0; int counter=0;
do  {
counter++;
if (counter==  iterations  +1) break; // Give up trying to prove guilty. point is innocent, and is in set.
 
// square:
double r     = sqrt(newx*newx + newy*newy + newz*newz) ;
double phi   = atan2( sqrt(newx*newx + newy*newy) ,      newz  );
double theta = atan2(newy , newx) ;
r = pow(r,power);
phi *=power; theta *=power;
newx = r * cos(theta ) * sin( phi  ) ;
newy = r * sin(theta ) * sin( phi  ) ;
newz = r * cos( phi  );

// add:
newx += x; newy += y; newz += z;
} while (newx*newx + newy*newy + newz*newz  <  1.25);

if (counter!=iterations+1) return false;
else return true;
}


Title: Re: Mandelbulb complete formula
Post by: GliderKite on November 13, 2010, 12:23:32 PM
Thanks, you understood perfectly.

So this forumla calculates whether that point is part of the set.

The color of the image I choose based on the number of what?

How should change the parameters of the function (x, y, z)?
What should be their range?

What is flag?

And finally: why< 1.25?


Title: Re: Mandelbulb complete formula
Post by: twinbee on November 13, 2010, 01:37:10 PM
Quote
The color of the image I choose based on the number of what?

The default is just white. You can colour it if you like, but for many of my first pictures, I created colour by using shadow and coloured light sources.

Quote
How should change the parameters of the function (x, y, z)?

What should be their range?

x, y & z bounds from +-1.02 to +-1.04 roughly for power 8. For the power 2 version, it could go as far as -+1.5.

Quote
And finally: why< 1.25?

Above 1.25 is the point that the formula 'gives up' and decides that it's going to spiral out to infinity, rather than close in to the origin at 0,0,0. Thus the point is not part of the set in that case. Remember in the case of the normal 2D Mandelbrot, that <2 is often chosen I think.


Title: Re: Mandelbulb complete formula
Post by: GliderKite on November 13, 2010, 02:43:00 PM
How can I understand the points that only belong to the Mandelbulb's surface?



Title: Re: Mandelbulb complete formula
Post by: twinbee on November 14, 2010, 01:09:36 AM
Just like the Mandelbrot, the Mandelbulb is solid. Determining the points for the surface only could be a difficult task (especially if you want an accurate thickness all the way around).