Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => The 3D Mandelbulb => Topic started by: Alef on December 18, 2011, 05:09:19 PM




Title: More natural Mandelbulb surfaces
Post by: Alef on December 18, 2011, 05:09:19 PM
Mandelbulbs are marvelous things, but their surfaces still could be somewhat are unnaturaly perfect.

With another formula I found that surfaces could be manipulated with iteration equations. http://www.fractalforums.com/3d-fractal-generation/gilgamesh-head-the-3d-mandelbulb-like-fractal/msg38938/ (http://www.fractalforums.com/3d-fractal-generation/gilgamesh-head-the-3d-mandelbulb-like-fractal/msg38938/) In mandelbulb formula at the end of iteration adding  z=(cabs(z)+ 0.1 )*z/cabs(z); a bitt increased mandelbulb colour density. The more interesting gets at the end of iteration adding some number.
Code:
z=quaternion(sx,sy,sz,0);
if(orbitincreaser==true)
{
z=z+5;
}
}
bool bailout(void)
return(sx*sx+sy*sy+sz*sz<bailout);
All linear colour formulas like age old bof60 on a mandelbulb surface shows a sine dot pattern. Result were are different in positive and negative quadrants. Could be the result of generated positive and negative z values. It don't changes geometry as bailout test don't uses z. Well, if bailout test would use z, maybe by adding aditional fractal dimension this would produce more natural surfaces.
[it was very late]


Title: Re: More natural Mandelbulb surfaces
Post by: Alef on December 18, 2011, 05:21:58 PM
[next day]
It realy does. Certain level of natural imperfection do makes result more realistic, but at the expense of increased of changing colour;) Since mandelbulb algorithm iterates sx, sy, sz, only final z is affected. Or more likely it just affects final solutions of equation.

Code:
...
z=quaternion(sx,sy,sz,0);
if(orbitincreaser==true)
{
z= z*1.618033988749894848204586834365;
}
}
bool bailout(void)
return( |z| <= bailout);

The depends mostly on bailout value, so single flag;) Replacing this with z=z*z+pixel; colour density is increased, but crack and wear pattern changes no more than changing bailout value. This thing should work on all triplex formulas, as all iterate sx, sy, sz instead o z.

Testing on (julia) underwater terrain and (julia) coral. Even Both have a bitt of more natural feel as crack pattern unlike of adding some texture depends on fractal geometry. Decreased colour density so fractal have colours of unmodified version.


Title: Re: More natural Mandelbulb surfaces
Post by: Alef on December 18, 2011, 05:26:15 PM
Testing on (mandel) cave. The second picture are with bailout maybe 100 or 1024, last picture are with bailout increased to 10000000000. Didn't changed colours. It don't looks more aesthetic, but it do looks more natural, like some ordinary sandstone cave.


Title: Re: More natural Mandelbulb surfaces
Post by: Alef on December 25, 2011, 04:49:58 PM
Well, maybe this could be implemented in colour algorithm. Colour methods use modulus of z, so  colours do not depend on positive or negative values. Adding 2 before calculcating modulus diferentiates positive and negative orbit value mandelbulb sides. If z=-n;  |z+n|=0, so all respective negative orbit values are marked with dots.

(http://www.ljplus.ru/img4/a/s/asdam/Number_mandelbulb_negative.jpg)

I put this into exponential smoothing colour technique (maybe the best so far), added simple cabs(z) colouring (sometimes exponential smoothing just don't work), and to decrease noise added iteration counter.

(http://www.ljplus.ru/img4/a/s/asdam/Nemo_numbersseeker.jpg)

Code:
NumberSeeker {
// By Edgars Malinovskis 20.12.2011
// -Z seeker marks respective negative escaping z values with dots (zeros)
// around 2D mandelbrots and on 3D mandelbulb
// Colours positive and negative quaternion hemispheres differently
// Colour method based on Exponenthial Smoothing developed by Ron Barnett
// and orbit colouring for quaternions. Zoom requires iteration increase.
// Good with mandel bulbs and brots but not so with sophisticated formulas.

double sum;
double sum2;
double cabsz;
complex zold;
parameter bool diverge;
parameter bool converge;
parameter bool modulusz;
parameter complex posneg;
parameter int iternum;
int cnt, iIter;

void init(void)
{
sum= 0.0;
sum2= 0.0;
zold= (0,0);
cabsz=0;

cnt=0;
iIter=iternum;
if (iIter>=maxiter)
{
iIter=maxiter-1;
}
}
void loop(void)
{

if (cnt <= iIter) //calculates colours just of first iterations
{
if  (diverge)
{
sum= sum+ exp(-cabs(z+posneg));
}
if  (converge)
{
sum2= sum2+ exp(-1/cabs(zold-z+posneg));
}
zold= z;
cnt=cnt+1;
if (modulusz)  // if nothing works this gives result
{
cabsz= cabs(z+posneg);
}
}
}
void final(void)
{
if  (|z- zold| < 0.5)  // bounded
{
if  (converge)
{
index= sum2;
}
else
{
index= cabsz;
}
   
}
else
{
// to infinity
if  (diverge)
{
index= sum;
}
else
{

index= cabsz;
}
}
}
void description(void)
{
this.title = "NumberSeeker";
 
diverge.caption = "Exp Smooth toInfinity";
diverge.default =  true;
diverge.hint = "If set, points which escape to infinity will be colored.";
 
converge.caption = "Exp Smooth toBounded";
converge.default =  true;
converge.hint = "If set, points which collapse to set will be colored.";

modulusz.caption = "Colouring by modulus of Z";
modulusz.default =  true;
modulusz.hint = "Use simple modulusZ method";
 
posneg.caption = "-Z Seeker (r,i)";
posneg.default =  (2.0, 0.0);
posneg.hint = "Adding number diverses negative Z areas";

iternum.caption="Use first N iterations";
iternum.default=15;
iternum.min=0;
iternum.hint="Lets you specify the iteration cycle at which you want to apply coloring";
}
}


Title: Re: More natural Mandelbulb surfaces
Post by: Alef on December 25, 2011, 04:56:17 PM
Nothing exeptional, but usable.  Much interesting result are in 2D. Mandelbrots looks like fake buddhabrots, z^3 mandelbrots have morning dew with dipping out numbers.

I think, I had seen the same fractal generated with some fake buddhabrot algorithm, but it just generated z*z mandelbrots.
(http://www.ljplus.ru/img4/a/s/asdam/Number_mandelbrot_negative.jpg)

This is nicer. power 3 do not lose positive and negative real value signs.
(http://www.ljplus.ru/img4/a/s/asdam/Number_mandelbrot3_negative.jpg)