Logo by Fiery - 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: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. April 18, 2024, 06:15:13 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]   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: Kaleidoscopic IFS in 4D  (Read 7348 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: October 28, 2011, 06:45:53 PM »

 grin cheesy grin

Okay! Those fractals were only in my dreams but two days ago I visited the photo gallery of Syntopia and I have seen this stunning image!!!

http://www.flickr.com/photos/syntopia/6012768734/in/pool-1554549@N24/

So I asked for the formula in a private message and he kindly shared his formula. wink Great dude cheesy

Code:
float Sierpinski4(vec4 z)
{
float r;

int n = 0;
while (n < Iterations) {

// This is the hyper-tetraedral folding
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.zy = -z.yz;
if(z.x+z.w<0.0) z.xw = -z.wx;
if(z.y+z.w<0.0) z.yw = -z.wy;
if(z.z+z.w<0.0) z.zw = -z.wz;
Rotate4D (z,Angles4D); // <- placed by me to make it a "true" KIFS

z = z*Scale - Offset4*(Scale-1.0);
n++;
}

return (length(z) ) * pow(Scale, -float(n));
}
Those are my formulas, still improvable I know ... cheesy

Code:
Menger4IFS(x,y,z,w){
   r=x*x+y*y+z*z;
   for(i=0;i<MI && r<bailout;i++){

      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;}
      if(x-w<0){x1=w;w=x;x=x1;}
      if(y-w<0){x1=w;w=y;y=x1;}
      if(z-w<0){y1=w;w=z;z=y1;}

      rotate4D(x,y,z,w);

      x=scale*x-CX*(scale-1);
      y=scale*y-CY*(scale-1);
      w=scale*w-CW*(scale-1);
      z-=0.5*CZ*(scale-1)/scale;
      z=-abs(-z);
      z+=0.5*CZ*(scale-1)/scale;
      z=scale*z;
     
      r=x*x+y*y+z*z;
   }
   return sqrt(x*x+y*y+z*z)*scale^(-i);

Code:
float Octahedron4(vec4 z)
{
// ... See Sierpinski4 until folding then

// This is the hyper-octaedral folding
// scale 2 and CScaleY=1 all other 0 should give you the normal octahedron
      x=abs(x);y=abs(y);z=abs(z);w=abs(w);
      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;}
        // ... fold w like in Menger4 ... and finally
// ... See Sierpinski4
}

For now that's all. cheesy
Logged

No sweat, guardian of wisdom!
eiffie
Guest
« Reply #1 on: October 29, 2011, 05:25:19 PM »

thank you both for these! I will just add you can get nice animations rotating per iteration
 if(i==1)Rotate4D(x,y,z,w,angle1);
 if(i==2)Rotate4D(x,y,z,w,angle2);
these conditionals won't slow your script down as all pixels take the same path
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #2 on: October 29, 2011, 08:05:46 PM »

Great suggestion indeed ... but since I cannot run those advanced blenders, and I am using Jesse's program I am forced to use  a limited number of params.
Jesse add more rooms cheesy
Logged

No sweat, guardian of wisdom!
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #3 on: October 29, 2011, 11:38:00 PM »


Hi Darkbeam, glad you like it!

Now, all this 4D stuff got me thinking. These systems, like the Quaternion Julia 4D system, work by choosing a 3D-volume "slice" of 4D space (for instance, a fixed w-value) and drawing it. This would be similar to visualizing a 3D system by drawing a 2D plane-slice from it. But normally we do a perspective projection from 3D to 2D instead. Isn't it possible to do the same for 4D systems using distance estimated ray marching?

I can see on Wikipedia (http://en.wikipedia.org/wiki/Tesseract), that people are doing 4D perspective projections of the Tesseract (4D cube), something which seem to result in much richer structures than simple 3D slices. Has anyone tried something similar for fractals?

Btw, I also did a 4D Menger thingy some time ago - I cannot find the formula, but I think it is similar to yours. I did a small animation here (starts out extremely slowly!): <a href="http://vimeo.com/moogaloop.swf?clip_id=20342823&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA" target="_blank">http://vimeo.com/moogaloop.swf?clip_id=20342823&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA</a>

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


Fragments of the fractal -like the tip of it


« Reply #4 on: October 30, 2011, 12:16:32 PM »

All fractals are similar, too bad similar is not enough wink grin

Anyway thanks again smiley
Logged

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


Fragments of the fractal -like the tip of it


« Reply #5 on: October 30, 2011, 12:30:40 PM »

Now, all this 4D stuff got me thinking. These systems, like the Quaternion Julia 4D system, work by choosing a 3D-volume "slice" of 4D space (for instance, a fixed w-value) and drawing it. This would be similar to visualizing a 3D system by drawing a 2D plane-slice from it. But normally we do a perspective projection from 3D to 2D instead. Isn't it possible to do the same for 4D systems using distance estimated ray marching?

I can see on Wikipedia (http://en.wikipedia.org/wiki/Tesseract), that people are doing 4D perspective projections of the Tesseract (4D cube), something which seem to result in much richer structures than simple 3D slices. Has anyone tried something similar for fractals?

Well we have this pretransform by Aexion, hope it helps cheesy

x' = abs( x + y + z) + Offset
y' = abs(-x - y + z) + Offset
z' = abs(-x + y - z) + Offset
w' = abs( x - Y - z) + Offset

PRETRANSFORM; do it once before all other calculations


* 3D gnarl.jpg (92.6 KB, 851x447 - viewed 736 times.)
« Last Edit: October 30, 2011, 12:34:20 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 #6 on: October 30, 2011, 12:52:11 PM »

Example 2 wink

Example of "4D rotation of the whole bulb" on a single axis shocked  huh?

Uploaded at ImageFra.me


* 3D gnarl.jpg (103.05 KB, 801x551 - viewed 675 times.)
« Last Edit: October 30, 2011, 01:00:22 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
Jesse
Download Section
Fractal Schemer
*
Posts: 1013


« Reply #7 on: October 30, 2011, 03:16:06 PM »


Hi Darkbeam, glad you like it!

Now, all this 4D stuff got me thinking. These systems, like the Quaternion Julia 4D system, work by choosing a 3D-volume "slice" of 4D space (for instance, a fixed w-value) and drawing it. This would be similar to visualizing a 3D system by drawing a 2D plane-slice from it. But normally we do a perspective projection from 3D to 2D instead. Isn't it possible to do the same for 4D systems using distance estimated ray marching?


I think you just have to use a 4d vector for stepping, define a z.w for the camera and a 4th vec component based on the 4d rotation of the camera.

Let it to you to post the first image of such a quat or ifs, since i am a bit slow at the moment  wink
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #8 on: October 30, 2011, 04:22:54 PM »


Hi Darkbeam, glad you like it!

Now, all this 4D stuff got me thinking. These systems, like the Quaternion Julia 4D system, work by choosing a 3D-volume "slice" of 4D space (for instance, a fixed w-value) and drawing it. This would be similar to visualizing a 3D system by drawing a 2D plane-slice from it. But normally we do a perspective projection from 3D to 2D instead. Isn't it possible to do the same for 4D systems using distance estimated ray marching?


I think you just have to use a 4d vector for stepping, define a z.w for the camera and a 4th vec component based on the 4d rotation of the camera.

Let it to you to post the first image of such a quat or ifs, since i am a bit slow at the moment  wink

Yes, I think most of the implementation should be straightforward, but there are some issues with the camera. In 3D (with a pinhole camera model) you have a camera position and direction, and the 2D viewport will be a plane orthogonal to the camera direction - the position and size of the viewport plane determines, how different the angles of each of the camera rays will be (and thus the FOV for x and y).

 In 4D space, you would have a (4D) camera position and camera direction. There is no 2D plane orthogonal to this 4D direction (instead there is an orthogonal 3D volume). So how do you decide the direction of the individual camera rays (for each pixel in the 2D viewport), given the 4D direction?

Well, I think I need to do some experiments or google it a bit more (I found this introduction: http://eusebeia.dyndns.org/4d/vis/vis.html, but it doesn't seem to be technical enough).
Logged
Jesse
Download Section
Fractal Schemer
*
Posts: 1013


« Reply #9 on: October 30, 2011, 10:39:04 PM »


Yes, I think most of the implementation should be straightforward, but there are some issues with the camera. In 3D (with a pinhole camera model) you have a camera position and direction, and the 2D viewport will be a plane orthogonal to the camera direction - the position and size of the viewport plane determines, how different the angles of each of the camera rays will be (and thus the FOV for x and y).

 In 4D space, you would have a (4D) camera position and camera direction. There is no 2D plane orthogonal to this 4D direction (instead there is an orthogonal 3D volume). So how do you decide the direction of the individual camera rays (for each pixel in the 2D viewport), given the 4D direction?

Well, I think I need to do some experiments or google it a bit more (I found this introduction: http://eusebeia.dyndns.org/4d/vis/vis.html, but it doesn't seem to be technical enough).


FOV came also into my mind after posting, a simple aproach would be to see it as a combination of two camera vector rotations of the xz and yz planes, so the w component would stay untouched.  Dunno if this makes much sense since i have not spend much time for this topic right now.

And maybe this would lead to more or less the same possibilities that you can already do with 4d rotations in M3D yet?
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
R-set of a kaleidoscopic IFS 3D Fractal Generation msltoe 3 2052 Last post January 20, 2011, 08:59:36 PM
by knighty
Kaleidoscopic Fractal Virus - The Image Still Frame KRAFTWERK 0 1573 Last post May 31, 2014, 04:48:21 PM
by KRAFTWERK
Kaleidoscopic Fractal Virus - The 3D Print Still Frame KRAFTWERK 0 1812 Last post May 31, 2014, 04:49:59 PM
by KRAFTWERK
Kaleidoscopic ifs Images Showcase (Rate My Fractal) BlooD2oo1 1 1349 Last post November 05, 2014, 12:43:49 PM
by Caleidoscope
Kaleidoscopic IFS fractal Images Showcase (Rate My Fractal) BlooD2oo1 4 1899 Last post November 17, 2014, 07:03:32 PM
by PieMan597

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