Okay, at least the slice at z=0 is okay. Can't know about other, but I copied faithfully the cube formula.
Now, I have released a Menger - Koch variation. But I am not that satisfied with it...
I wanted to draw a Menger sponge with some "towers" over each hole. The best result I can get is this.
I do this;
FLD QWORD PTR DS:[ESI-78]
FSUB ST,ST(2)
FABS <------ folds st(1)
FXCH ST(2)
FSTP ST
FSUB QWORD PTR DS:[ESI-80]
FABS <------ folds st
FNOP
If I multiply with something, nothing happens or shapes become weird.
dunno who is ST(2) or ST, due to the many swaps it's confusing...
This is done here (formula from
http://www.fractalforums.com/3d-fractal-generation/kaleidoscopic-(escape-time-ifs)/ )
Menger3(x,y,z){
r=x*x+y*y+z*z;
for(i=0;i<MI && r<bailout;i++){
rotate1(x,y,z);
x=abs(x);y=abs(y);z=abs(z);
if(x-y<0){x1=y;y=x;x=x1;}
if(x-z<0){x1=z;z=x;x=x1;}
if(y-z<0){y1=z;z=y;y=y1;}
*** FOLDING *** rotate2(x,y,z);
x=scale*x-CX*(scale-1);
y=scale*y-CY*(scale-1);
z=scale*z;
if(z>0.5*CZ*(scale-1)) z-=CZ*(scale-1);
r=x*x+y*y+z*z;
}
return (sqrt(x*x+y*y+z*z)-2)*scale^(-i);
}
Dunno if this can be improved.
If I do a conditional folding, the shapes are cutted off with a weird effect. I must do everything without conditions (it seems)
param
Mandelbulb3Dv16{
M....Es....V1...w....2.............6.1.......s3E................................
................................8QxckpX05z1........Y./..................y.2.....
................/ME//....6Uy....e/....E2.....2e8GShyvfsD/..........c./...w1....U
z.....kD..../..........wz.............................................sD...../..
.w1...sD..cjZvMS3tn6C1JzzzzvzOEUhUisqclD2Rw3Oc.cazXCrqeAEZc2zSWyooeAVOyj.Zh4j8Hc
aznAWreAEZc2zconlUV0UOyD......oE......................sD..kz0...................
.............................UJRR4.wppN.6OLb/.mRR4.irpN.EVLb/UCSR4..............
...........................U..6.P....M4...EB....W....61....F....8/...I1....UJl12
...U.iVFwxDE./ozPM2Tzz7lz16.mc..zXCc.El18XGQeGyDjvIRhrVAkz1............28.kFrA0.
FWb96aAIVzvh1se7Umvxz0........../6U0.wzzz1................................E.0c..
zzzz.................................2U.8.kzzzD.................................
/6U0.wzzz1...................................2CcN/UvNP6.eeWCNq0.yRii.EJJUk1f..XR
S1.mx3CcN/UvNP6.QsLsUa3.ibhV..bTV1OK.sSq40.ly3CcN/UvNP6.MwLsUa3.ibhV.kqTV1OK.sSq
40.kz3CcN/UvNP6...EsUa3.eeWCNq0.IJ36wk8.wyLsUa3.................................
E....2....E.....I....k....EHZtqNZ7rGjB4O.IaQ..............................U/4MU/
4M.................0./.......UzD........sz1........wz...........................
.............................................6/E........kz9.....................
........................}