Logo by simon.snake - 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 20, 2024, 04:25:54 AM


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 ... 6 7 [8] 9   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: Implementing MixPinski  (Read 20093 times)
0 Members and 1 Guest are viewing this topic.
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #105 on: November 28, 2016, 05:39:21 AM »

Placing a swizzle transform before mixPinski is  afro IMHO. I will add it as an option on the UI.

In MandelbulberV2 dev version, I test each combination and notice that some combinations have better DE image quality, these are the combinations I then explore further.

The code below is from MandelbulberV2, and was  coded for a combo box, but each combination can simple have a checkBox

Sometime I should extend this for 4D


// swizzle order of z vector every iteration
// swizzle pos neg iteration
void TransformZvectorAxisSwapIteration(CVector3 &z, const cFractal *fractal)
{
   switch (fractal->mandelbulbMulti.orderOfxyz) // comboBox
   {
      case sFractalMandelbulbMulti::xyz:
      default: p = CVector3(p.x, p.y, p.z); break;
      case sFractalMandelbulbMulti::xzy: p = CVector3(p.x, p.z, p.y); break;  //   or   p.yz = p.zy;
      case sFractalMandelbulbMulti::yxz: p = CVector3(p.y, p.x, p.z); break;  //   or   p.xyz = p.yxz;
      case sFractalMandelbulbMulti::yzx: p = CVector3(p.y, p.z, p.x); break;
      case sFractalMandelbulbMulti::zxy: p = CVector3(p.z, p.x, p.y); break;
      case sFractalMandelbulbMulti::zyx: p = CVector3(p.z, p.y, p.x); break;
   }
   if (EnabledxFalse) p.x = -p.x;
   if (EnabledyFalse) p.y = -p.y;
   if (EnabledzFalse) p.z = -p.z;
}
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #106 on: November 29, 2016, 11:42:58 PM »

I have been sidetracked and working backwards smiley , by coding up mixPinski,  sierpinski4d and then finally sierpinski3D

If we take the sierpinski code from the mixPinski4D and add in a scale of default 2, and having a negative offset at default (1,1,1,1) we have a sierpinski4D.

My mixPinski UI has been updated to include a sierpinski scale set at default = 1.

Then we can add other linear types before and after this transform.

      if (p.x + p.y < 0.0) p = p.xy = -p.yx;
      if (p.x + p.z < 0.0) p = p.xz = -p.zx;
      if (p.y + p.z < 0.0) p = p.yz = -p.zy;

      if (p.x + p.w < 0.0) p = p.xw = -p.wx;
      if (p.y + p.w < 0.0) p = p.yw = -p.wy:
      if (p.z + p.w < 0.0) p = p.zw = -p.wz;

   p = p * scale2; // scale default 2
   Dd *= scale2;


   if (i >= startIter && i < stopIter)    // defaults 0 and 30?
   {
      p -= offset1111; // neg offset default ( 1,1,1,1)
   }

   //add rotation


BTW  My mixPinski UI has been updated to include a sierpinski scale set at default = 1.



* sierpinski4D bbb2 S6.jpg (217.65 KB, 600x600 - viewed 317 times.)
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #107 on: November 29, 2016, 11:46:33 PM »

Good job alien smiley
Logged

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



« Reply #108 on: November 30, 2016, 01:34:41 AM »

Now for Sierpinski3D. I have included the code for  Darkbeams reversed full tetra-fold  as well, but I have yet to figure it out.

Sierpinski3D is fast (33 sec for this 3200x2400 render) and the DE calc quality is really good.

I have just randomly been testing combinations with other linear type transforms and it is very cool!!

BTW this is default settings looking down the MandelbulberV2 y_axis

   //Normal full tetra-fold;
   if (normalEnabled)
   {

          if (z.x - z.y < 0.0) z.xy = z.yz;
          if (z.x - z.z < 0.0) z.xz = z.zx;
          if (z.y - z.z < 0.0) z.yz = z.zy;
          if (z.x + z.y < 0.0) z.xy = -z.yx;
          if (z.x + z.z < 0.0) z.xz = -z.zx;
          if (z.y + z.z < 0.0) z.yz = -z.zy;
   }
   z = z * scale2;
   Dd *= scale2;


   if (i >= startIter && i < stopIter)
   {
      z -= offset111; // neg offset
   }

   // add rotation

   //Reversed full tetra-fold;
       /*if (z.x + z.y < 0.0) z.xy = -z.yz;
       if (z.x + z.z < 0.0) z.xz = -z.zx;
       if (z.y + z.z < 0.0) z.yz = -z.zy;
       if (z.x - z.y < 0.0) z.xy = z.yx;
       if (z.x - z.z < 0.0) z.xz = z.zx;
       if (z.y - z.z < 0.0) z.yz = z.zy;*/


* sierpinsk3D ccc1.jpg (219.45 KB, 675x900 - viewed 313 times.)
Logged
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« Reply #109 on: November 30, 2016, 01:40:18 AM »

@mclarekin Saw your Sierpinski-image and already hoped you'd add it too! wink Very cool! Will try and see what I can get as soon the humble Mandelbrot releases me from its claws!

 
Logged

sabine62.deviantart.com
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #110 on: November 30, 2016, 04:34:09 AM »

@ sarbine.

Reciprocal3b , I am about  include this option in my OpenCL code.

This is the optimising (although it is not really necessary in Fragmentarium, because it is so fast)



Before the loop, we do this maths so that we do not have to do it every iteration:
double limitC = 1/Lim1 + 1/Lim2;

In the loop:
x' = sign(x)(limitC - 1/(abs(m1 * x) + Lim1 ) - 1/(m2 * x*x+ Lim2 ) )
Logged
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« Reply #111 on: November 30, 2016, 01:51:10 PM »

@mclarekin Ohh thank you for that, mclarekin! To be honest, I hadn't looked into optimizing it in Fragmentarium. I guess I was too much over the moon that I got it working at all  grin But optimising should get into my system as it should be done Always smiley
Logged

sabine62.deviantart.com
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #112 on: December 04, 2016, 10:23:20 PM »

So now I have coded the M3D Menger4, ( it is so cool!) and now I can finally see how the complete mixPinski was created.  Now I will do the 4D rotation, and i will then be finished

 (BTW DarkBeam suggested I code the MixPinski way back in June.  Good things take time grin)

This is the menger4D code I will use as the basis of a .frag
   float scaleM  default 3.0
   vec4 offsetM  default (1.0,1.0,0.5,0.5);
   vec4 opt1 = scaleM - 1.0;
   offsetM *= opt1;
   float opt2 = 0.5 * offsetM.z  / scaleM;

   vec4 PreAdd default (0.0,0.0,0.0,0.0);


// iteration loop
   if (i >= StartPreAdd && i < StopPreAdd)
   {
      z4D += PreAdd_vec4_0000; // offset
   }


   z4D = abs(z4D);
   vec4 temp4;

   if ( z4D.x - z4D.y < 0.0) { temp4.x = z4D.y; z4D.y = z4D.x; z4D.x = temp4.x ;}
   if ( z4D.x - z4D.z < 0.0) { temp4.x = z4D.z; z4D.z = z4D.x; z4D.x = temp4.x ;}
   if ( z4D.y - z4D.z < 0.0) { temp4.y = z4D.z; z4D.z = z4D.y; z4D.y = temp4.y ;}
   if ( z4D.x - z4D.w < 0.0) { temp4.x = z4D.w; z4D.w = z4D.x; z4D.x = temp4.x ;}
   if ( z4D.y - z4D.w < 0.0) { temp4.x = z4D.w; z4D.w = z4D.y; z4D.y = temp4.x ;}
   if ( z4D.z - z4D.w < 0.0) { temp4.y = z4D.w; z4D.w = z4D.z; z4D.z = temp4.y ;}

   // temp3D rot

   if (rot && i >= StartRot && i < StopRot)
   {
      //Temp3D rotation
   }




   z4D.x = scaleM * z4D.x - offsetM.x;
   z4D.y = scaleM * z4D.y - offsetM.y;
   z4D.w = scaleM * z4D.w - offsetM.w;
   z4D.z -= opt2;
   z4D.z = -fabs(-z4D.z);
   z4D.z += opt2;
   z4D.z *= scaleM;
   Dd *= scaleM;

   // bailout 10
   // return sqrt(x* x + y* y + z* z)*scale^(-i);
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #113 on: December 07, 2016, 12:11:59 AM »

Here is the Menger4 in a ,frag

* menger4_e-1_Files.zip (191.48 KB - downloaded 188 times.)
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #114 on: December 07, 2016, 12:19:23 AM »

This is what I get in OpenCL


* Menger4D default.jpg (194.69 KB, 580x600 - viewed 301 times.)
Logged
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #115 on: December 07, 2016, 05:55:14 PM »

Iteration weight code!  cheesy 
Logged

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


Fragments of the fractal -like the tip of it


« Reply #116 on: December 07, 2016, 11:55:27 PM »

Finally smiley happy for you cheesy and all people.
Those 4d kids except MixP were made from a formula kindly given to me by Syntopia the genius of Fragmentarium! smiley
Logged

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



« Reply #117 on: December 08, 2016, 02:00:48 AM »

@ Matt, Iteration Weight is good for Menger3 and PrismShapes.

I prefer to use Mandlebulber Curvi-Linear Algorithm Randomly Evolved Knavish Iteration Numberlisation  (the MCLAREKIN), which I simply call VCL in MandlebuldberV2.10, (as shown in the attached para-graph). I have this working on Scale, MinR2 and SphericalOffset transforms.  I will make a .frag  including a VCL transform soon.


BTW Now that I have the Menger4 working I have been able to properly test out SphericalFold4D.  I have found that under certain settings I can use three DOT modes :

/float r2=z4.x*z4.x+z4.y*z4.y; //Dot2
//float r2=z4.x*z4.x+z4.y*z4.y+z4.z*z4.z; //Dot3
//float r2=z4.x*z4.x+z4.y*z4.y+z4.z*z4.z+z4.w*z4.w;  //Dot4

But it is tricky finding workable combinations of minR2 and maxR2.

@ DrakBeam.  I have coded up most of the 4D matrix rotation in MandelbulberV2, grin. I will soon be into the lengthy debugging period, sad


* para-graph.jpg (66.36 KB, 897x769 - viewed 307 times.)
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #118 on: December 08, 2016, 09:39:40 AM »

Image of dot modes 2,3 & 4.  It is kind of interesting. May be more so in another fractal?


* Dot modes.jpg (221.53 KB, 1200x446 - viewed 409 times.)
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #119 on: December 10, 2016, 03:04:20 AM »

In the wonderful world of 4D there are many more options to play with.

I have been experimenting in Fragmentarium and Mandelbulber V1.21 OpenCL.  My latest Menger4 UI works like this

a)   We have our Initial w to set prior to iterating. Then we iterate:-

b) We add a parabolic-iteration based function operating on z4.w.

//Menger4D VCL w
//based on Synatopia & Darkbeams Menger4

//ITERATION LOOP
//
// Iter loop :parab_w,  pre_add,  menger_Rot_sponge, sphericalFold

//09-12-16   
   float para = 0.0;
   if (EnabledParabolic)
   {
      parabolicAddP0 = offsetP + (i * slopeP)   + (i * i * 0.001 * scaleP);
   }
   z4.w += parabolicAddP0;

c) we add to the Menger4 the option to turn off the separate  z4.z function and instead scale & offset z4.z the same way as the other three axis.
// scale  and offset
   z4.x = scaleM * z4.x - offsetM.x;
   z4.y = scaleM * z4.y - offsetM.y;
   z4.w = scaleM * z4.w - offsetM.w;
   if(EnableCondz == 1)
   {
      z4.z = scaleM * z4.z - offsetM.z;
   }
   else
   {
      z4.z -= opt2;
      z4.z = -fabs(-z4.z);
      z4.z += opt2;
   }
 d) With the SphericalFold we add in options for  various dot modes

if (EnableSphFold == 1)// 4D sphfold
   {
      r2 = z4.x*z4.x + z4.y*z4.y;

      if (Dot3 == 1)   { r2 +=    z4.z*z4.z ;}
      if (Dot4 == 1)   { r2 +=    z4.w*z4.w ;}   


The attached image shows that with some settings the parabolic  (i * i * scaleP)   can be used to adjust the surface texture detail.



* slope.jpg (237.53 KB, 1061x534 - viewed 302 times.)
Logged
Pages: 1 ... 6 7 [8] 9   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Help about implementing the perturbation theory Programming « 1 2 » CFJH 23 2320 Last post May 14, 2015, 06:40:57 PM
by therror
mixPinski 1600 Mandelbulber Gallery mclarekin 3 954 Last post November 19, 2016, 02:54:00 AM
by paigan0
mixPinski sphFold Mandelbulber Gallery mclarekin 0 1168 Last post November 19, 2016, 10:27:57 AM
by mclarekin
Implementing ABoxModKaliEiffie Amazing Box, Amazing Surf and variations « 1 2 3 » mclarekin 30 10682 Last post November 27, 2016, 11:52:55 AM
by Sabine
Implementing Menger Sponge 45 rot Sierpinski Gasket mclarekin 9 3555 Last post December 04, 2016, 10:49:35 PM
by DarkBeam

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