Logo by mauxuam - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. April 16, 2024, 12:02:47 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1] 2 3   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: "New" fractal type; Mandalay (in KIFS/ non KIFS versions)  (Read 10271 times)
0 Members and 1 Guest are viewing this topic.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« on: March 08, 2015, 11:44:06 AM »

This is my attempt to realize a Mandalex without adding any discontinuity! cheesy
The idea seems simple but it's not. smiley

--------------------

The Mandalex has nice "towers", it kind of extrudes Mandelbox adding nice towers at the edges.
This is also possible with folding.
If you do it carefully, you can even keep axis orthogonal, this is fundamental to keep fractal details. I think I managed ti in 2D, not 100% sure of 3D ..........
.......
...because I made it just following my intuition
 embarrass
Master Knighty please take a look!!! afro

This is my Evaldraw 2D script.
To visualize the fold change last line to; -xf to see negative x folded, yf or -yf to see y fold. They should be perfectly orthogonal and continuous. Azn

Code:
(x,y)
   //press F1 for help
   //press ALT/ESC for menu
double nx = abs(x);
double ny = abs(y);
double fo = .5; // change!!!!
double g = .9; // change!!!!
double fx = -2*fo+nx;
double fy = -2*fo+ny;
double xf = (fo-abs(-fo+nx));
double yf = (fo-abs(-fo+ny));
double gx = g+nx;
double gy = g+ny;

  if (fx > 0 && fx>ny) { // && fx>nz presumably
    if (fx>gy) {
     // square edge:
     xf += g;
     // orthogonal axis must stay ortho:
     yf = (fo-abs(g-fo+ny));
     // do similarly zf here...
    } else {
     // top:
     xf = -ny;
     // orthogonal axis must stay ortho:
     yf = (fo-abs(-3*fo+nx));
     // do similarly zf...
    }
  }
  if (fy > 0 && fy>nx) { // && fy>nz presumably
    if (fy>gx) {
     // square edge:
     yf += g;
     xf = (fo-abs(g-fo+nx));
     // do similarly zf...
    } else {
     // top:
     yf = -nx;
     // orthogonal axis must stay ortho:
     xf = (fo-abs(-3*fo+ny));
     // do similarly zf...
    }
  }
-xf

This is a Fragmentarium horrible script, it gives nice strange cubes ... wink
Don't know if axis are really ortho. If not ... it's incorrect but don't know how to fix it  wink wink embarrass

Code:
#info Mandelbox Distance Estimator (Rrrola's version).
#define providesInit
#include "DE-Raytracer.frag"
#include "MathUtils.frag"
#group Mandelbox

/*
The distance estimator below was originalled devised by Buddhi.
This optimized version was created by Rrrola (Jan Kadlec), http://rrrola.wz.cz/

See this thread for more info: http://www.fractalforums.com/3d-fractal-generation/a-mandelbox-distance-estimate-formula/15/
*/

// Number of fractal iterations.
uniform int Iterations;  slider[0,17,300]
uniform int ColorIterations;  slider[0,3,300]

uniform float MinRad2;  slider[0,0.25,2.0]

// Scale parameter. A perfect Menger is 3.0
uniform float Scale;  slider[-3.0,3.0,5.0]
vec4 scale = vec4(Scale, Scale, Scale, abs(Scale)) / MinRad2;

// precomputed constants

uniform vec3 RotVector; slider[(0,0,0),(1,1,1),(1,1,1)]

// Scale parameter. A perfect Menger is 3.0
uniform float RotAngle; slider[0.00,0,180]

mat3 rot;

void init() {
rot = rotationMatrix3(normalize(RotVector), RotAngle);
}

float absScalem1 = abs(Scale - 1.0);
float AbsScaleRaisedTo1mIters = pow(abs(Scale), float(1-Iterations));


// Compute the distance from `pos` to the Mandelbox.
float DE(vec3 pos) {
vec4 p = vec4(pos,1), p0 = p;  // p.w is the distance estimate
         p0 =vec4 (1.,-1.,1.,1.); // Julia mode for dummies ^_________^

for (int i=0; i<Iterations; i++) {
p.xyz*=rot;
float nx = abs(p.x);
float ny = abs(p.y);
float nz = abs(p.z);
float fo = .5;
float g = .9;
float fx = -2.*fo+nx;
float fy = -2.*fo+ny;
float fz = -2.*fo+nz;
float xf = (fo-abs(-fo+nx));
float yf = (fo-abs(-fo+ny));
float zf = (fo-abs(-fo+nz));
float gx = g+nx;
float gy = g+ny;
float gz = g+nz;

  if (fx > 0 && fx>ny&& fx>nz) {
    if (fx>gy&& fx>gz) {
     // square edge:
     xf += g;
     // orthogonal axis must stay ortho:
     yf = (fo-abs(g-fo+ny));
     zf = (fo-abs(g-fo+nz));
    } else {
     // top:
     xf = -max(ny,nz);
     // orthogonal axis must stay ortho:
     yf = (fo-abs(-3.*fo+max(nx,nz)));
     zf = (fo-abs(-3.*fo+max(ny,nx)));
    }
  }
  if (fy > 0 && fy>nx&& fy>nz) {
    if (fy>gx&& fy>gz) {
     // square edge:
     yf += g;
    // orthogonal axis must stay ortho:
     xf = (fo-abs(g-fo+nx));
     zf = (fo-abs(g-fo+nz));
    } else {
     // top:
     yf = -max(nx,nz);
     // orthogonal axis must stay ortho:
     xf = (fo-abs(-3.*fo+max(ny,nz)));
     zf = (fo-abs(-3.*fo+max(ny,nx)));
    }
  }
  if (fz > 0 && fz>nx&& fz>ny) {
    if (fz>gx&& fz>gy) {
     // square edge:
     zf += g;
     // orthogonal axis must stay ortho:
     xf = (fo-abs(g-fo+nx));
     zf = (fo-abs(g-fo+nz));
    } else {
     // top:
     zf = -max(ny,nx);
     // orthogonal axis must stay ortho:
     xf = (fo-abs(-3.*fo+max(ny,nz)));
     yf = (fo-abs(-3.*fo+max(nx,nz)));
    }
  }
             p.x = xf; p.y =yf; p.z = zf;
float r2 = dot(p.xyz, p.xyz);
if (i<ColorIterations) orbitTrap = min(orbitTrap, abs(vec4(p.xyz,r2)));
p *= clamp(max(MinRad2/r2, MinRad2), 0.0, 1.0);  // dp3,div,max.sat,mul
p = p*scale + p0;
             if ( r2>1000.0) break;

}
return ((length(p.xyz) - absScalem1) / p.w - AbsScaleRaisedTo1mIters);
}

#preset Inside 1
FOV = 0.62536
Eye = -1.16945,-1.12305,-2.79412
Target = 6.16354,-1.00522,-2.00173
Up = -0.619851,-0.17831,0.764193
Detail = -3.09736
DetailAO = -0.28574
FudgeFactor = 0.81928
MaxRaySteps = 220
Dither = 0.5
AO = 0,0,0,0.7
Specular = 2.4348
SpecularExp = 16
SpotLight = 1,1,1,0.73563
SpotLightDir = -0.52,0.1
CamLight = 1,1,1,1.15384
CamLightMin = 0.15151
Glow = 0.0941176,0.341176,0.87451,0.31507
Fog = 0.5
HardShadow = 0
Reflection = 0
BaseColor = 1,1,1
OrbitStrength = 0.5625
X = 0.411765,0.6,0.560784,-0.21312
Y = 0.666667,0.666667,0.498039,0.86886
Z = 0.666667,0.333333,1,-0.18032
R = 0.4,0.7,1,0.31372
BackgroundColor = 0.6,0.6,0.45
GradientBackground = 0.3
CycleColors = false
Cycles = 7.03846
FloorNormal = 0,0,0
FloorHeight = 0
FloorColor = 1,1,1
Iterations = 10
ColorIterations = 2
MinRad2 = 0.25
Scale = 2.39128
RotVector = 1,1,1
RotAngle = 0
#endpreset

#preset Other
FOV = 0.4
Eye = 0.136312,-0.357184,2.20031
Target = -2.1701,4.89792,-1.82586
Up = -0.314748,0.483089,0.817043
AntiAlias = 1
Detail = -2.97353
DetailAO = -0.21074
FudgeFactor = 1
MaxRaySteps = 110
BoundingSphere = 7.5904
Dither = 0.5
AO = 0,0,0,0.7
Specular = 4
SpecularExp = 16
SpotLight = 1,1,1,0.4
SpotLightDir = 0.1,0.1
CamLight = 1,1,1,1
CamLightMin = 0.15151
Glow = 1,1,1,0
Fog = 0.02684
HardShadow = 0.58462
Reflection = 0
BaseColor = 1,1,1
OrbitStrength = 0.8
X = 0.5,0.6,0.6,0.7
Y = 1,0.6,0,0.4
Z = 0.8,0.78,1,0.5
R = 0.4,0.7,1,0.12
BackgroundColor = 0.6,0.6,0.45
GradientBackground = 0.3
CycleColors = false
Cycles = 7.03846
FloorNormal = 0,0,0
FloorHeight = 0
FloorColor = 1,1,1
Iterations = 18
ColorIterations = 3
MinRad2 = 0.0172
Scale = -1.49272
RotVector = 1,1,1
RotAngle = 0
#endpreset

#preset Default
FOV = 0.56284
Eye = -1.80087,13.736,2.87241
Target = -1.52812,3.93906,2.87915
Up = -0.296524,-0.00759792,0.954991
Detail = -2.35396
DetailAO = -0.28574
FudgeFactor = 1
MaxRaySteps = 105
Dither = 0.5
AO = 0,0,0,0.7
Specular = 4
SpecularExp = 16
SpotLight = 1,1,1,0.4
SpotLightDir = -0.33334,0.1
CamLight = 1,1,1,1
CamLightMin = 0.4697
Glow = 1,1,1,0.17808
Fog = 0
HardShadow = 0
Reflection = 0
BaseColor = 1,1,1
OrbitStrength = 0.8
X = 0.5,0.6,0.6,0.7
Y = 1,0.6,0,0.4
Z = 0.8,0.78,1,0.5
R = 0.4,0.7,1,0.12
BackgroundColor = 0.596078,0.6,0.513725
GradientBackground = 0.3
CycleColors = false
Cycles = 7.03846
FloorNormal = 0,0,0
FloorHeight = 0
FloorColor = 1,1,1
Iterations = 12
ColorIterations = 3
MinRad2 = 0.25
Scale = 2.04344
RotVector = 1,1,1
RotAngle = 0
#endpreset

#preset M1
FOV = 0.4
Eye = 3.4315,-5.57625,-2.47321
Target = -1.74219,2.244,1.00192
Up = -0.820324,-0.551717,-0.15059
AntiAlias = 1
Detail = -2.78761
DetailAO = -0.28574
FudgeFactor = 0.916
MaxRaySteps = 112
BoundingSphere = 7.1083
Dither = 0.5
AO = 0,0,0,0.96721
Specular = 1.4167
SpecularExp = 18.8
SpotLight = 1,1,1,0.17391
SpotLightDir = 0.31428,0.1
CamLight = 1,1,1,1.41936
CamLightMin = 0.4697
Glow = 0.835294,0.0784314,0.0784314,0
Fog = 0.45638
HardShadow = 0
Reflection = 0
BaseColor = 1,1,1
OrbitStrength = 0.515
X = 0.6,0.0117647,0.0117647,0.59056
Y = 1,0.6,0,0.44882
Z = 1,1,1,0.49606
R = 0.666667,0.666667,0.498039,0.07936
BackgroundColor = 0.666667,0.666667,0.498039
GradientBackground = 0.3
CycleColors = false
Cycles = 7.03846
FloorNormal = 0,0,0
FloorHeight = 0
FloorColor = 1,1,1
Iterations = 17
ColorIterations = 3
MinRad2 = 0.25
Scale = 3
RotVector = 1,1,1
RotAngle = 0
#endpreset


#preset Noname
FOV = 0.2439
Eye = -19.9282,-27.7195,21.9276
Target = -14.6946,-21.4244,16.5391
Up = 0.312177,0.454534,0.83422
EquiRectangular = false
FocalPlane = 1
Aperture = 0
Gamma = 2.4074
ToneMapping = 5
Exposure = 1
Brightness = 1
Contrast = 1
Saturation = 1
GaussianWeight = 1
AntiAliasScale = 2
Detail = -3.22126
DetailAO = -0.28574
FudgeFactor = 1
MaxRaySteps = 198
Dither = 0.5
NormalBackStep = 1
AO = 0,0,0,0.7
Specular = 0.30392
SpecularExp = 45.833
SpecularMax = 10
SpotLight = 1,1,1,0.4
SpotLightDir = -0.20988,0.1
CamLight = 1,1,1,1.82608
CamLightMin = 0.4697
Glow = 1,1,1,0
GlowMax = 20
Fog = 0.064
HardShadow = 0.45122 NotLocked
ShadowSoft = 6.3292
Reflection = 0
DebugSun = false
BaseColor = 1,1,1
OrbitStrength = 0.37662
X = 0.5,0.6,0.6,-0.8835
Y = 1,0.6,0,0.4
Z = 0.8,0.78,1,0.5
R = 0.4,0.7,1,0.12
BackgroundColor = 0.596078,0.6,0.513725
GradientBackground = 0.3
CycleColors = false
Cycles = 7.03846
EnableFloor = true NotLocked
FloorNormal = 0,0,0.17074
FloorHeight = -6.4
FloorColor = 1,1,1
Iterations = 12
ColorIterations = 3
MinRad2 = 0.25
Scale = 2.04344
RotVector = 1,1,1
RotAngle = 0
#endpreset
« Last Edit: March 09, 2015, 05:16:44 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #1 on: March 08, 2015, 11:58:34 AM »

Image (awful) embarrass


* mandalay.png (240.47 KB, 621x495 - viewed 729 times.)
Logged

No sweat, guardian of wisdom!
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #2 on: March 08, 2015, 12:11:40 PM »

it looks different but has the temple aspects of the box/mandelx wink please continue wink
Logged

---

divide and conquer - iterate and rule - chaos is No random!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #3 on: March 08, 2015, 12:21:09 PM »

it looks different but has the temple aspects of the box/mandelx wink please continue wink

Can you render it with the other software? I can't because it does not work here, and I must go out for lunch smiley
Logged

No sweat, guardian of wisdom!
knighty
Fractal Iambus
***
Posts: 819


« Reply #4 on: March 08, 2015, 01:11:50 PM »

I must go out for lunch smiley
Me too.  grin head batting
Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #5 on: March 08, 2015, 02:42:04 PM »

lunch? splendid idea cheesy
Logged

---

divide and conquer - iterate and rule - chaos is No random!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #6 on: March 08, 2015, 04:25:39 PM »

Me too.  grin head batting
Ack... you don't need to eat! Aren't you a cyborg?!  alien evil
Lazy people grin
Logged

No sweat, guardian of wisdom!
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #7 on: March 08, 2015, 05:15:56 PM »

This is a Fragmentarium horrible script...
May I render it?  embarrass )
Logged

knighty
Fractal Iambus
***
Posts: 819


« Reply #8 on: March 08, 2015, 05:19:18 PM »

After  head batting head batting head batting then  head batting again I got this for 2D:
Code:
(x,y){
   fo = mousx*0.01; // change!!!!
   g = mousy*0.01; // change!!!!
#if 0
   dbFold(x,y,fo,g);
#else
   dbknFold(x,y,fo,g);
#endif
   //(sin(x)+sin(y))*0.25+0.5//
   sin(sqrt(x*x+y*y)*2)*0.5+0.5
}
DBKNFold(&x,&y,fo,g){
   x=abs(x); y=abs(y);//axis folds
   t=max(0,y-x); x+=t; y-=t;//diagonal fold
   x-=fo; x=abs(x);
   x-=fo;
   t=min(g,max(0,x-y)); x-=t; y+=t;//Odd fold (like the mandelbox fold). abs() like folds are even.
   y-=fo; y=-abs(y); y+=fo;
}
I'll try to see how it works in 3D this evening or tomorrow. I think it should be something like this:
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #9 on: March 08, 2015, 05:21:17 PM »

May I render it?  embarrass )
Of course! Everybody can cheesy
I am curious to see Knighty's result wink
Logged

No sweat, guardian of wisdom!
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« Reply #10 on: March 08, 2015, 06:42:38 PM »

Me too Me too Me too! What I got until now is really quite horrible. But I am rendering anyway, with 1000 subframes. Why 1000 subframes? Because I never did that  whistling and rolling eyes Meanwhile, gpu is almost cremated...
Logged

sabine62.deviantart.com
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #11 on: March 08, 2015, 07:15:20 PM »

Me too Me too Me too! What I got until now is really quite horrible. But I am rendering anyway, with 1000 subframes. Why 1000 subframes? Because I never did that  whistling and rolling eyes Meanwhile, gpu is almost cremated...

Set scale = 2... Scale 3 is not good cheesy
Logged

No sweat, guardian of wisdom!
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« Reply #12 on: March 08, 2015, 07:47:23 PM »

Aborted the render at 38%... Checked, Scale was set to 1.94... fiery
 grin
Logged

sabine62.deviantart.com
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #13 on: March 08, 2015, 08:22:56 PM »


Btw The 3D formula has cuts, so it's surely wrong fiery fiery fiery
Logged

No sweat, guardian of wisdom!
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #14 on: March 08, 2015, 08:27:46 PM »

Rotated  smiley I called this "Transformation"

Logged

Pages: [1] 2 3   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Special "offset" and "rotate" options from Fractallab possible in M3d-formula? Mandelbulb 3d « 1 2 » SaMMy 18 29330 Last post April 05, 2011, 12:20:52 PM
by DarkBeam
KIFS and the "fold and cut problem" IFS - Iterated Function Systems knighty 5 6039 Last post May 22, 2011, 02:40:25 PM
by knighty
I had a vague idea that "fractal" was related to "pretty pictures" Meet & Greet Repomancer 5 8241 Last post October 10, 2012, 02:04:23 AM
by David Makin
proclamation: "twitch" hybrid type (new) Theories & Research cKleinhuis 6 522 Last post September 02, 2015, 11:49:49 PM
by cKleinhuis
"cannot combine with previous 'type-name' declaration specifier" Bug Reporting vitke 2 2190 Last post January 30, 2016, 05:16:01 PM
by vitke

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.167 seconds with 25 queries. (Pretty URLs adds 0.011s, 2q)