Welcome to Fractal Forums

Fractal Software => Gestaltlupe Gallery => Topic started by: trafassel on January 14, 2017, 12:51:37 AM




Title: News from the Mandelbox
Post by: trafassel on January 14, 2017, 12:51:37 AM
News from the Mandelbox

(http://nocache-nocookies.digitalgott.com/gallery/19/999_14_01_17_12_51_36.jpeg)

http://www.fractalforums.com/index.php?action=gallery;sa=view;id=19944

// CenterX=-0.916032152744961 CenterY=0.877148216230017
// CenterZ=11.2158712835104 Radius=0.568000286566819
public override bool GetBool(double x,double y,double z)
{
  for (int i=0;i < 66;  i++)
  {
    x=x%2;
    z=z%2;
    while(Math.Abs(x)>0.5)
    {
      if(x>0.5)x=1-x;
      if(x<-0.5)x=-1-x;
    }
    while(Math.Abs(z)>0.5)
    {
      if(z>0.5)z=1-z;
      if(z<-0.5)z=-1-z;
    }
    double xx=x*x;
    double yy=y*y;
    double zz=z*z;
    double r=xx+yy+zz;
    if(r>0)
    {
      x /=-r;
      y /=-r;
      z /=-r;
      if(r>0.00000000001 && i>2)
      {
        Red+=xx/r;
        Green+=yy/r;
        Blue+=zz/r;
      }
      if(r<0.3)return false;
    }
    x=-x;
    x+=0.02;
    y+=1.925;
    z+=0.95;
  }
  return true;
}