Logo by fractalwizz - 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: Visit us on facebook
 
*
Welcome, Guest. Please login or register. April 23, 2024, 01:12:08 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 [4] 5 6 7   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: Cross Menger!? Can anyone do this?  (Read 20166 times)
0 Members and 2 Guests are viewing this topic.
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #45 on: September 26, 2016, 09:34:16 AM »

A finally coded the KIFS version grin


* PrismKIFS asa1.jpg (96.79 KB, 550x451 - viewed 89 times.)

* PrismKIFS asa4.jpg (109.87 KB, 550x509 - viewed 85 times.)
Logged
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #46 on: September 28, 2016, 04:09:31 PM »

Looks like robot or constructor  smiley

CrossMenger in PseudoKleinian:
Logged

Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #47 on: October 05, 2016, 03:53:01 PM »

Shared PseudoKleinian-CrossMenger hybrid
Logged

mclarekin
Fractal Senior
******
Posts: 1739



« Reply #48 on: October 07, 2016, 01:45:14 AM »


//  This is the simplest version of Knighty prismshape that I have used as a pre-transform in several formula UI's
// I forgot to add the Xcondition checkbox in the PrismShapeOption.frag i posted yesterday

const float SQRT_3_4  = 0.86602540378443864676372317075294;
const float SQRT_3 =  1.73205080756887729352744634150587;
uniform vec3 offsetScale; slider[(-1,-1,-1),(0,0,0),(1,1,1)]
uniform float dotScale; slider[0.0,1.0,2.0]
uniform bool PrismShape; checkbox[true]
uniform bool Xcondition; checkbox[true]




   if (PrismShape) { // a pre-transform, no DE required
      z = vec3({z.z, z.x, z.y); // reorientate

      z.z = abs(z.z);      
      float dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * dotScale; 
      float t = max(0.0, dot1);
      z.x -= t * -SQRT_3;
      z.y = abs(z.y - t);
      if(z.y > z.z){ temp =z.y; z.y = z.z;   z.z = temp;}
      z -= offsetScale * vec3{ SQRT_3_4, 1.5, 1.5}; 
      if(z.z > z.x){temp =z.z; z.z = z.x; z.x = temp;}

      if (Xcondition) {
         if(z.x >= 0.0){ z.y = max(0.0, z.y); z.z = max(0.0, z.z);}
      }
   }

// then iterate a menger sponge

// when dotScale = 2.0 ,  is standard house shape
// when offset scale = (-0.5, 0, 0),  is the prism shape (for this version)
// X Condition. With some settings parts of the fractal become "extrusions", if this is not wanted then untick this checkBox
Logged
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #49 on: October 07, 2016, 09:04:11 AM »

... in the PrismShapeOption.frag i posted yesterday
Where?  smiley
Logged

mclarekin
Fractal Senior
******
Posts: 1739



« Reply #50 on: October 07, 2016, 11:06:12 AM »

I hid it here grin
http://www.fractalforums.com/images-showcase-(rate-my-fractal)/spires-t24633/msg96518/#new

It  has just been inserted into 3dickulus's   .frag, so probably need to zoom out at first

I  was re-learning this prism thing yesterday. This is the version that makes the house shape.

You can add this to the Prism Shape pre-transform (openCL code)

z *= postScale;//  vect3 default (1,1,1)
z = Matrix33MulFloat3(consts->fractal.mandelbox.mainRot, z); // rotations


and this is the formula code inside the  menger sponge iteration loop

Code:
//PreAdd and Knighty MengerSponge
z = fabs( z + preAdd ); // preadd default (0,0,0)
if (z.x - z.y < 0.0f){temp = z.y; z.y = z.x; z.x = temp;}
if (z.x - z.z < 0.0f){temp = z.z; z.z = z.x; z.x = temp;}
if (z.y - z.z < 0.0f){temp = z.z; z.z = z.y; z.y = temp;}
z *= mengerScale; // default 3
z.x -= 2.0f;
z.y -= 2.0f;
if (z.z > 1.0f) z.z -= 2.0f;
DE *= mengerScale;


//postAddition
z =  z  + postAdd; // postAdd default (0,0,0)
// make it hollow
z.x = fabs(z.x + tempA) + tempB;  // defaults float 0 and 0,  something like  1 and -1 will make the mengerSponge  hollow

if (negY == 1) // turning on a tweak that works depending  on other parameters are set to.
{z.y = -z.y;

}

and
// bailout termination
if (r > 10.0f) //bailout
    {
      dist = r / fabs(DE);
      out.colourIndex = colourMin * 10.0f;
      break;
   }





Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #51 on: October 29, 2016, 06:17:52 AM »

Latest version of crossmenger trick

Adding in the fabs(z.x) option provides another ... eh.. option.
The derivative scale thingy is a beta thingy, that can work in some hybrid situations.

Images below are with a dotscale of 0.2,   and with and without fabs(z.x)

#define SQRT_3_4 0.86602540378443864676372317075294
#define SQRT_3 1.73205080756887729352744634150587

Code:
	if (crossMengerTrickEnabled
&& i >= startIterations
&& i < stopIterations)

{ // CrossMengerTrick. Tweaks on Knighty_Maths
double dd = DE;
z.y = fabs(z.y);
z.z = fabs(z.z);
if ( FabsZEnabled)
{
z.x = fabs(z.x);
}

dot1 = ( z.x * -SQRT_3_4 + z.y * 0.5 ) * DotScale;
double t = max(0.0, dot1);
z.x -= t * -SQRT_3;

if (Mod1Enabled)
{
z.y = fabs(z.y) - t;
}
else
{
z.y = fabs(z.y - t);
}
z.x -= SQRT_3_4;
double dy = 0.0;
double dz = 0.0;
if (z.y > 0.5 && z.z > 0.5)
{
dy = 1.5;
dz = 1.5;
}
else if ((z.y - 1.5) * (z.y - 1.5) + z.z * z.z < z.y * z.y + (z.z - 1.5) * (z.z - 1.5))
{
dy = 1.5;
}
else
dz = 1.5;

z.y -= dy;
z.z -= dz;
z *= MengerScale;
DE *= MengerScale;
z.y += dy;
z.z += dz;
z.x += SQRT_3_4;

if (DerivativeScaleEnabled)
{
dd *=  DerivativeScale;
z *= dd;
aux.DE *= dd;
}
DE *= DEtweak;
}


* CMT.jpg (37.2 KB, 648x168 - viewed 85 times.)

* PrismShape2 hnu1a 24.jpg (99.05 KB, 379x360 - viewed 203 times.)

* PrismShape2 hnu1b 3.jpg (90.2 KB, 500x416 - viewed 205 times.)
« Last Edit: October 29, 2016, 10:29:57 AM by mclarekin, Reason: fixed conversion mistakes » Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #52 on: October 29, 2016, 08:38:37 AM »

And the dotScale can even go negative in some situations. Bringing the parameter to -0.1 has made this shape hollow.


* PrismShape2 hob4 680.jpg (210.09 KB, 680x680 - viewed 84 times.)
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #53 on: October 31, 2016, 12:43:52 AM »

These images have an exp2 transform used for 2 or 3 iterations. 

In brief;  This transform can be used with most standard type formulas (but can be a bit tricky to use.)

we are modifying  so that     z = z + a_proportion _of exp2(z.x)

Here is the beginning code,  repeat for y and z. (even though there is no DE calc, I also insert a DE tweak at the end which can help)
Code:
		CVector3 tempZ = z;

if (fractal->transformCommon.functionEnabledx) // enable exp2(z.x)
{
if (fractal->transformCommon.functionEnabledAx) // enable fabs (z.x)
{
tempZ.x = fabs(z.x);
if (fractal->transformCommon.functionEnabledAxFalse) //  enable if you want to use the flatter negative part of the pow curve
{
tempZ.x = -tempZ.x;
}
tempZ.x = exp2(tempZ.x * fractal->transformCommon.constantMultiplier000.x) - 1.0;
if (z.x > 0)
z.x += tempZ.x;
else
z.x -= tempZ.x;
}
else
z.x += exp2(tempZ.x * fractal->transformCommon.constantMultiplier000.x) - 1.0;
}


* cmt exp2 007.jpg (131.12 KB, 584x534 - viewed 84 times.)

* cmt exp2 009 12.jpg (92.13 KB, 467x446 - viewed 194 times.)
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #54 on: October 31, 2016, 10:32:45 AM »

Exp is too strong as deform and slows de sad
You should use a polynome valid in range -1 to 1 then extend it with some linear expression. cheesy
Or try to use my reciprocalx3 it is a rational polynomial that never goes to infinity.
Logged

No sweat, guardian of wisdom!
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #55 on: November 01, 2016, 02:36:05 AM »

@darkbeam

thanks, I will code up  the reciprocalx3 type.  "Deform" is the word I have been looking for  smiley,  the parameter tweaking iteration_count  stuff, that I have also been working on are "deformers".


The main reason behind the exp2 transform is that apparently I once made the attached image out of a mandelbox with some exp2 working on one axis, and I want to recreate it to find out how it worked.


 


* Fractal Radio Wave.jpg (72.04 KB, 900x675 - viewed 82 times.)
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #56 on: November 03, 2016, 02:06:23 AM »

Well Reciprocal3 has got me sidetracked cheesy  I even graphed it.  And I am now getting a SIGN()  function added to the Mandelbulbers maths

Here it is for a single iteration to deform the cross menger trick,    Image 001 running at iteration 0, and then image 002 at iteration 1 (after the first crossmenger trick iteration ) in the hybrid loop.


* cmt recipr3 001 54 2400.jpg (107.47 KB, 550x550 - viewed 85 times.)

* cmt recipr3 002 85 2400.jpg (111.37 KB, 550x550 - viewed 80 times.)
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #57 on: November 03, 2016, 08:07:38 AM »

Woow it looks nice cheesy in mb3d sometimes it stretches fractals to the infinity. There are versions also for y and z that do very different things on kifs fractals (that do intense coord swapping) like Menger, Sierpinski SierpHilbert etc... cheesy and usually it is alternated for every iter to get strange futuristic buildings.
« Last Edit: November 03, 2016, 08:27:52 AM by DarkBeam » Logged

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



WWW
« Reply #58 on: November 07, 2016, 09:33:47 AM »

Code:
const float SQRT_3_4  = 0.86602540378443864676372317075294;
const float SQRT_3 =  1.73205080756887729352744634150587;
uniform vec3 offsetScale; slider[(-1,-1,-1),(0,0,0),(1,1,1)]
uniform float dotScale; slider[0.0,1.0,2.0]
uniform bool PrismShape; checkbox[true]
uniform bool Xcondition; checkbox[true]

if (PrismShape) { // a pre-transform, no DE required
z = vec3({z.z, z.x, z.y); // reorientate

z.z = abs(z.z);
float dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * dotScale;  
float t = max(0.0, dot1);
z.x -= t * -SQRT_3;
z.y = abs(z.y - t);
if(z.y > z.z){ temp =z.y; z.y = z.z; z.z = temp;}
z -= offsetScale * vec3{ SQRT_3_4, 1.5, 1.5};  
if(z.z > z.x){temp =z.z; z.z = z.x; z.x = temp;}

if (Xcondition) {
if(z.x >= 0.0){ z.y = max(0.0, z.y); z.z = max(0.0, z.z);}
}
}

error?
z = vec3({z.z, z.x, z.y); // reorientate
Can you see my .frag? What's wrong?

Tried another code from your latest posts, what is fabs? Did you used Fragmentarium?

* cm_prism-test.bmp Files.zip (10 KB - downloaded 48 times.)

* cm_prism-test.jpg (23.66 KB, 565x374 - viewed 83 times.)
« Last Edit: November 07, 2016, 10:32:37 AM by Crist-JRoger » Logged

DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #59 on: November 07, 2016, 05:25:02 PM »

Just found ChebyMenger from an Eiffie shadertoy! Lool, fantastic grin

Code:
/// Chebymenger by eiffie

#define Pi 4.0
float Cos(float a){return clamp(abs(mod(a,2.0*Pi)-Pi)-Pi/2.0,-1.0,1.0);}
float Sin(float a){return Cos(a-Pi/2.0);}
vec2 CosSin(float a){return vec2(Cos(a),Sin(a));}
float Length(vec2 p){return max(abs(p.x),abs(p.y));}//==(x^inf+y^inf)^(1/inf)
float Length(vec3 p){return max(abs(p.x),max(abs(p.y),abs(p.z)));}
float Atan(vec2 p){
if(p.y==0.0)return (p.x>0.0?0.0:4.0);
float a=p.x/p.y;
if(abs(a)<1.0){
if(p.y>0.0)return 2.0-a;
else return 6.0-a;
}else {
a=p.y/p.x;
if(p.x>0.0)return mod(a,8.0);
else return 4.0+a;
}
}
vec2 Rotate(vec2 p,float a){return CosSin(Atan(p)+a)*Length(p);}

const int iters=4;
float psni=pow(3.0,-float(iters)),tym=iGlobalTime;
float DE(in vec3 p){//menger with chebyshev rotation
p.xy=Rotate(p.xy,tym);
//p.xz=Rotate(p.xz,tym);//for more weirdness
for (int n = 0; n < iters; n++) {
p = abs(p);
if (p.x<p.y)p.xy = p.yx;
if (p.x<p.z)p.xz = p.zx;
if (p.y<p.z)p.yz = p.zy;
p = p*3.0 - 2.0;
if(p.z<-1.0)p.z+=2.0;
}
return (Length(p)-1.0)*psni*0.707;//.707 compensates for the square rotation
}
Logged

No sweat, guardian of wisdom!
Pages: 1 2 3 [4] 5 6 7   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
cross 2D Art ramblerette 0 1547 Last post March 29, 2009, 02:28:49 PM
by ramblerette
At the Cross Images Showcase (Rate My Fractal) John Smith 0 1167 Last post June 10, 2012, 10:43:53 PM
by John Smith
Cross JWildfire Gallery thargor6 1 855 Last post December 06, 2012, 04:04:30 AM
by Pauldelbrot
3D Printed Cross Sections of the Menger Sponge Format, Printing & Post Production tit_toinou 6 5581 Last post April 29, 2013, 03:35:56 PM
by cKleinhuis
Cross Mandelbulb3D Gallery MichaelWGioffredi 0 902 Last post April 22, 2015, 11:33:06 AM
by MichaelWGioffredi

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.272 seconds with 25 queries. (Pretty URLs adds 0.017s, 2q)