trafassel
Fractal Bachius
Posts: 531
|
|
« on: November 24, 2016, 11:26:56 PM » |
|
// Gestaltlupe 3.4
double _scale=4; double _offsetX=1.5; double _offsetY=1.5; double _offsetZ=1.5; double _bailout=2; double _angleX=0; double _angleY=0; double _angleZ=0;
public override void Init() { base.Init(); // Plaese remove this after pressing 2 times the button above: // (This set fixed formula Parameters) if(GetString("intern.Formula.TempUpdateVal")!="021462bd1ab1887e87f23a9ace4f4e0a") { SetParameterBulk(@"Formula.Parameters: angleX=0 angleY=0 angleZ=45 bailout=2 offsetX=2.1 offsetY=1 offsetZ=1 scale=2 Formula.Static: Cycles=12 Julia=1 jx=0.9 jy=0 jz=0 Scene: CenterX=0.0965003528449048 CenterY=-1.34226795790199 CenterZ=0.160980835845237 Radius=0.349530254720366 Transformation.Camera: AngleX=-39.2596575417366 AngleY=74.1173281658452 AngleZ=-99.2265259659284 IsometricProjection=0 Position=1 intern.Formula: TempUpdateVal=021462bd1ab1887e87f23a9ace4f4e0a"); }
// Load current Parameters: _scale=GetOrSetDouble("scale"); _offsetX=GetOrSetDouble("offsetX"); _offsetY=GetOrSetDouble("offsetY"); _offsetZ=GetOrSetDouble("offsetZ"); _bailout=GetOrSetDouble("bailout"); _angleX=Math.PI/180.0*GetOrSetDouble("angleX"); _angleY=Math.PI/180.0*GetOrSetDouble("angleY"); _angleZ=Math.PI/180.0*GetOrSetDouble("angleZ"); } // Menger Sponge
public override bool GetBool(double x,double y,double z) { // Switch between mandel and julia mode: double jx,jy,jz; if (_isJulia) { jx=_jx; jy=_jy; jz=_jz; } else { jx=x; jy=y; jz=z; x=_jx; y=_jy; z=_jz; }
for (int n=1;n < _cycles; n++) {
// Menger Sponge Formula: x=Math.Abs(x); y=Math.Abs(y); z=Math.Abs(z); if(x>_bailout)return false; if(y>_bailout)return false; if(z>_bailout)return false; if (x<y) { double a=x; x=y; y=a; } if (x< z) { double a=x; x=z; z=a; } if (y<z) { double a=y; y=z; z=a; } x=_scale*x-_offsetX*(_scale-1); y=_scale*y-_offsetY*(_scale-1); z=_scale*z-_offsetZ*(_scale-1); if(z<-0.5*_offsetZ*(_scale-1.0))z+=_offsetZ*(_scale-1.0); if(_angleX!=0)Rotate(_angleX,ref y,ref z); if(_angleY!=0)Rotate(_angleY,ref x,ref z); if(_angleZ!=0)Rotate(_angleZ,ref x,ref y); // Julia / Mandel iteration: x+=jx; y+=jy; z+=jz; } return true; }
void Rotate(double angle,ref double x,ref double y) { double re=Math.Cos(angle ); double im=Math.Sin(angle ); double a=re * x-im * y; y=re * y+im * x; x=a; }
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius
Posts: 531
|
|
« Reply #1 on: November 24, 2016, 11:40:56 PM » |
|
angleX=45 angleY=0 angleZ=0 bailout=230 offsetX=1 offsetY=0.666666666666667 offsetZ=0.5 scale=3 Formula.Static: Cycles=12 Julia=1 jx=0.833333333333333 jy=0 jz=0
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius
Posts: 531
|
|
« Reply #2 on: November 25, 2016, 09:32:20 PM » |
|
angleX=0 angleY=0 angleZ=0 bailout=230 offsetX=1.05 offsetY=1 offsetZ=1 scale=2.2 Formula.Static: Cycles=16 Julia=1 jx=0.575 jy=0 jz=0
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius
Posts: 531
|
|
« Reply #3 on: November 25, 2016, 10:05:32 PM » |
|
18 Iterations
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius
Posts: 531
|
|
« Reply #4 on: November 27, 2016, 02:05:45 PM » |
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius
Posts: 531
|
|
« Reply #5 on: November 30, 2016, 07:53:37 AM » |
|
Same formula, but the line:
if( z<-0.5*_offsetZ*(_scale-1.0)) z+=_offsetZ*(_scale-1.0);
ist removed:
Fractal Parameters: angleX=0 angleY=0 angleZ=45 bailout=2 offsetX=1.1 offsetY=1.2 offsetZ=1 scale=1.8 Cycles=100 Julia=1 jx=0.1 jy=0.1 jz=0.225
Scene Parameters: CenterX=-0.825851928838657 CenterY=-0.137484062991961 CenterZ=-0.263178096264692 Radius=1.57641612156358E-05 AngleX=71.9789945332988 AngleY=28.6324642779303 AngleZ=-63.414564994788 IsometricProjection=0 Position=1
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius
Posts: 531
|
|
« Reply #6 on: November 30, 2016, 07:57:54 AM » |
|
Here you see a cut in the same Menger Sponge spiral. The green surface belongs to the "inside" while the grey very regular looking structures is an "outside view".
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #7 on: November 30, 2016, 09:27:23 AM » |
|
The last to images are really cool, I have not seen that shape before The attached transform works well with menger sponges ( less so for other fractals ). And I note that the coder seems to have forgotten to put in a linear DE adjustment for the scale ( hmmm??? that must have been me ) I will go and fix that now, and it should work better.
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #8 on: November 30, 2016, 10:34:40 AM » |
|
I found a weird "i -1" in the code, how it got there I do not know. This is what it should look like, (now I better go and fix the 4D version.) /** * iteration weight. Influence fractal based on the weight of * Z values after different iterations */ void TransformIterationWeightIteration(CVector3 &z, int i, const cFractal *fractal, sExtendedAux &aux) { CVector3 zA, zB;
if (i == fractal->transformCommon.intA) { zA = z; } if (i == fractal->transformCommon.intB) { zB = z; } z = (z * fractal->transformCommon.scale) + (zA * fractal->transformCommon.offset) + (zB * fractal->transformCommon.offset0); aux.DE *= fractal->transformCommon.scale; aux.r_dz *= fractal->transformCommon.scale; }
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius
Posts: 531
|
|
« Reply #9 on: December 01, 2016, 07:47:51 AM » |
|
mclarekin wrote: And I note that the coder seems to have forgotten to put in a linear DE adjustment for the scale ( hmmm??? that must have been me )
There is a simple reason for this: I hardly ever use DE in my renderings. DE adds additional lines to the formula (i like simpleness) and it was not very helpful in finding the 3D mandelbrot fractal. At least for me. Disadvantage of not using distance estimatation is longer rendering time and often noisy surface normals - especially for some grailish looking examples, like the following one (yes, there are fractal doughnuts in the box). // Menger Sponge Tree public override bool GetBool(double x,double y,double z) { double sin45 = Math.Sqrt(0.5); double scale = 1.81; double offsetX = 1.15; double offsetY = 0.932; double offsetZ = 1.01; for (int n=1;n<100;n++) { x = Math.Abs(x); y = Math.Abs(y); z = Math.Abs(z); // Bailout Condition: if (x>2) return false; if (y>2) return false; if (z>2) return false; if (x<y) { double a=x; x=y; y=a; } if (x<z) { double a=x; x=z; z=a; } if (y<z) { double a=y; y=z; z=a; } x = scale*x - offsetX*(scale-1); y = scale*y - offsetY*(scale-1); z = scale*z - offsetZ*(scale-1); // Rotate x,y plane by 45 degree: double xtemp = sin45 * ( x - y ); y = sin45 * ( y + x ); x = xtemp; } return true; }
Here the menger sponge tree lies in the center of the box (CenterX=-0.0945155196775858 CenterY=-0.130152813333983 CenterZ=-0.0796293685094792 Radius=0.261524932786483).
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius
Posts: 531
|
|
« Reply #10 on: December 02, 2016, 12:30:11 PM » |
|
A cut through one of the doughnuts.
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius
Posts: 531
|
|
« Reply #11 on: December 05, 2016, 07:58:07 PM » |
|
Formula.Parameters: angleX=0 angleY=0 angleZ=45 bailout=3 offsetX=1.2 offsetY=1.1 offsetZ=0.8 scale=1.6 Formula.Static: Cycles=75 Julia=1 jx=0 jy=0 jz=0 Scene: CenterX=-0.817698103133137 CenterY=1.2024566146392 CenterZ=0.484242312734027 Radius=0.0135254036224944
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius
Posts: 531
|
|
« Reply #12 on: December 06, 2016, 09:12:28 PM » |
|
I do not notice that Krzysztof Marczak has made 2013 a better version of my video in reply #4 .At minute 3:00 you see the broken picture frame of my first image.
https://www.youtube.com/v/NIWz3BuE4nE&rel=1&fs=1&hd=1The only missing thing was a inner view of a menger sponge with 100 iterations, which seems to be unexplored. Here is an outer view of the 45° menger sponge with a cut at z>0. Formula.Parameters: angleX=0 angleY=0 angleZ=45 bailout=6000000 offsetX=0.6 offsetY=2.8 offsetZ=0 scale=1.35 Formula.Static: Cycles=75 Julia=1 jx=0.15 jy=0 jz=0
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #13 on: December 06, 2016, 10:33:37 PM » |
|
This is REALLY interesting thanks
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
mclarekin
|
|
« Reply #14 on: December 07, 2016, 12:10:08 AM » |
|
They are so good, so many different shapes (you can see where my last gallery post came from thanks)
|
|
|
Logged
|
|
|
|
|