Finaly animated the fractal. Calculations took three days, three nights, three hours, 22 minutes and three by three seconds. Result are suprisingly realistic
(for the soft), but it don't zoomed so well as do mandelbulbs, as it don't generates clean close picture with the same parameters as for distance wiev. But changing parameters changes details.
http://www.youtube.com/v/0F2_V_5zmZc&rel=1&fs=1&hd=1Final code was using z*z*z+k*z as it allows creating Bender or Buddha like heads.
GilgameshHead (quaternion) {
//18.12.2011. by Edgars Malinovskis.
//Based on mandelbar. Rotating quaternion parts around matrix creates results in all dimensions.
//You my redistribute, modify, derivate or use comercialy as you wish as long as you give proper credits.
parameter real bailout, coef1, coef2, coef3, coef4;
parameter int settype, powers;
parameter bool testInverted, testNumbers, testAdvanced, depthincreaser;
parameter quaternion julia, perturb;
quaternion C;
void init(void)
{
if (testInverted==true && settype=="Julia Set")
{
z = recip(pixel);
C = julia;
}
else if (settype=="Julia Set")
{
z = pixel;
C = julia;
}
else if (testInverted==true && settype=="Mandelbrot Set")
{
z = perturb;
C= recip(pixel);
}
else
{
z=perturb;
C=pixel;
}
}
void loop(void)
{
if (testNumbers==true)
{
//manipulate numbers so that x^2 >< y^2 >< z^2
z= quaternion ( real(z) , imag(z), part_j(z) + part_k(z), 0.5*part_k(z) - part_j(z) );
}
if (testAdvanced==false)
{
//Basic. Matrix of -> z^pow and numbers: real, imag, j, k. All parts are in each column and row.
z= z*z*z+C;
z= quaternion ( imag(z) , real(z), part_k(z), part_j(z) );
z= z*z*z;
z= quaternion ( part_k(z) , part_j(z), imag(z), real(z) ) ;
z= z*z*z;
z= quaternion ( part_j(z) , imag(z), real(z), part_k(z) ) ;
z= z*z*z;
z= quaternion ( real(z) , part_k(z), part_j(z), imag(z) );
}
else if (testAdvanced==true && powers=="3,3,3,3")
{
z= z*z*z+C+z*coef1;
z= quaternion ( imag(z) , real(z), part_k(z), part_j(z) );
z= z*z*z+z*coef2;
z= quaternion ( part_k(z) , part_j(z), imag(z), real(z) ) ;
z= z*z*z+z*coef3;
z= quaternion ( part_j(z) , imag(z), real(z), part_k(z) ) ;
z= z*z*z+z*coef4;
z= quaternion ( real(z) , part_k(z), part_j(z), imag(z) );
}
else if (testAdvanced==true && powers=="4,4,4,4")
{
z= sqr(sqr(z))+C+z*coef1;
z= quaternion ( imag(z) , real(z), part_k(z), part_j(z) );
z= sqr(sqr(z))+z*coef2;
z= quaternion ( part_k(z) , part_j(z), imag(z), real(z) ) ;
z= sqr(sqr(z))+z*coef3;
z= quaternion ( part_j(z) , imag(z), real(z), part_k(z) ) ;
z= sqr(sqr(z))+z*coef4;
z= quaternion ( real(z) , part_k(z), part_j(z), imag(z) );
}
else if (testAdvanced==true && powers=="5,4,2,3")
{
z= sqr(sqr(z))*z+C+z*coef1;
z= quaternion ( imag(z) , real(z), part_k(z), part_j(z) );
z= sqr(sqr(z))+z*coef2;
z= quaternion ( part_k(z) , part_j(z), imag(z), real(z) ) ;
z= sqr(z)+z*coef3;
z= quaternion ( part_j(z) , imag(z), real(z), part_k(z) ) ;
z= z*z*z+z*coef4;
z= quaternion ( real(z) , part_k(z), part_j(z), imag(z) );
}
else if (testAdvanced==true && powers=="5,5,5,5")
{
z= sqr(sqr(z))*z+C+z*coef1;
z= quaternion ( imag(z) , real(z), part_k(z), part_j(z) );
z= sqr(sqr(z))*z+z*coef2;
z= quaternion ( part_k(z) , part_j(z), imag(z), real(z) ) ;
z= sqr(sqr(z))*z+z*coef3;
z= quaternion ( part_j(z) , imag(z), real(z), part_k(z) ) ;
z= sqr(sqr(z))*z+z*coef4;
z= quaternion ( real(z) , part_k(z), part_j(z), imag(z) );
}
if(depthincreaser==true)
{
z= z+0.1*z/cabs(z);
}
}
bool bailout(void)
{
return( abs(real(z))+ abs(imag(z)) + abs(part_j(z)) + abs(part_k(z)) < bailout );
}
void description(void)
{
this.title = "Gilgamesh Head (Quaternion)";
this.helpfile="http://www.fractalforums.com/3d-fractal-generation/gilgamesh-head-the-3d-mandelbulb-like-fractal/";
bailout.caption = "Bailout Value";
bailout.default = 12.0;
bailout.min = 0.5;
bailout.hint = "Defines the bailout radius: If pixel falls out of it, the iteration stops. Larger number increases details";
settype.caption = "Set type";
settype.enum = "Mandelbrot Set\nJulia Set";
settype.default = 0;
testInverted.caption="Inverted 'Cave' Set";
testInverted.default=false;
testNumbers.caption="Manipulated Numbers x^2 >< y^2 >< z^2";
testNumbers.default=false;
depthincreaser.caption="+Surface z=(cabs(z)+0.1)*z/cabs(z)";
depthincreaser.default=false;
julia.caption = "Julia Parameter";
julia.default = (-0.73,0.3,-0.5,0.3);
julia.hint = "Different values create different Julia Sets.";
julia.visible = (settype=="Julia Set");
testAdvanced.caption="Additional Options ->";
testAdvanced.default=false;
coef1.caption = "K of z=z^n+K*z+c";
coef1.default = 0;
coef1.hint = "Implements linear z to the matrix of equations.";
coef1.visible = (testAdvanced==true);
coef1.min = -2.1;
coef1.max = 2.1;
coef2.caption = "K2 of z=z^n+K2*z";
coef2.default = 0;
coef2.visible = (testAdvanced==true);
coef2.min = -2.1;
coef2.max = 2.1;
coef3.caption = "K3 of z=z^n+K3*z";
coef3.default = 0;
coef3.visible = (testAdvanced==true);
coef3.min = -2.1;
coef3.max = 2.1;
coef4.caption = "K4 of z=z^n+K4*z";
coef4.default = 0;
coef4.visible = (testAdvanced==true);
coef4.min = -2.1;
coef4.max = 2.1;
powers.caption = "Equation Powers n";
powers.enum = "3,3,3,3\n4,4,4,4\n5,4,2,3\n5,5,5,5";
powers.default = 0;
powers.visible = (testAdvanced==true);
perturb.caption = "Base Point/perturbation";
perturb.default = (0,0,0,0);
perturb.hint = "Starts calculation with this number.";
perturb.min = -0.9;
perturb.max = 0.9;
perturb.visible = (testAdvanced==true && settype=="Mandelbrot Set");
}
}