Logo by DsyneGrafix - 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: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. November 29, 2020, 12:13:57 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 ... 6   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: An interesting fractal, the Mandelex (inspired by the box)  (Read 6688 times)
0 Members and 1 Guest are viewing this topic.
Hiato
Forums Freshman
**
Posts: 14


« on: December 29, 2012, 02:02:19 AM »

EDIT 2: I updated the code to reflect cKleinhuis' changes (there were always two parameters governing most of the transforms, now they are vec2's) and removed the unused circle and abs things that were probably just confusing people.

EDIT: I realise this may not be the correct subforum for this post, and I apologise ahead of time if I have filed this incorrectly, it just seemed the most appropriate place at a cursorsy glance

Hello all,

I realise this is my second ever post here but I am rather excited to share my first original (in the sense that it arose from 'scratch' for me) creation, the Mandelex (yes, it can look a bit like an X sometimes). I'll let the pictures do the talking, but a quick formula can't hurt (see code for details):

p -> nonLinearPull(boxWrap(circleInversion(s*rotation(linearPull(p)+c))))

where boxWrap is TGlad's I think, linearPull is just a special translation, nonLinearPull is nearly a coordinate modulus and the rest is fairly easy to see. Interestingly enough, by wrapping the whole thing up in another linearPull, we achieve almost an entire nesting of the pattern at each of the corners (hence the X). It contains a whole bunch of different patterns and shapes, but like some of these IFS thingies, it's a bit hard to tweak the escape time and iteration count to get a clean render (it seems, actually, that bailout can be arbitrarily large without much adverse effects, but iterations are tricky) - I cheated and squared the fraction of iterations survived so as to add some contrast to the renders. Anyway, I would be interested in extending this guy to 3D, any words of advice?

---
Here is an overview of the whole thing without the extra linearpull, and at the risk of destroying folks' bandwidth, I've merely linked to some other renders



https://www.dropbox.com/s/36ku46syduezp0h/mandelex_center.png
https://www.dropbox.com/s/dhpgkmcl2rza4lx/mandelex_upper_right.png
https://www.dropbox.com/s/z8vk61gjpw0zawp/mandelex_addlin_minilex.png
https://www.dropbox.com/s/q1kk27b6aazry5l/mandelex_additional_linear.png
(if these don't work, you can try here instead)

I would encourage all to explore this thing, and so I have here a Fragmentarium file for you to play around with tongue stuck out

Enjoy
« Last Edit: December 29, 2012, 04:56:45 PM by Hiato » Logged
Kali
Fractal Supremo
*****
Posts: 1138


« Reply #1 on: December 29, 2012, 09:45:05 AM »

Very nice... I didn't study the code yet, but I got really interesting patterns playing with it. 3D version could be also great, I'll see if I can help...

This is from a Julia version of it: http://zoom.it/xn5t

« Last Edit: December 29, 2012, 10:46:08 AM by Kali » Logged

|</\|_|
░░░░░░░

http://fractkali.deviantart.com/
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #2 on: December 29, 2012, 12:43:51 PM »

Very interesting, 3d extension should be easy grin
Logged

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


formerly known as 'Trifox'


WWW
« Reply #3 on: December 29, 2012, 12:46:05 PM »

can you elaborate the formula parts with explicit code examples ?
wohoo, a new formula!!!
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 #4 on: December 29, 2012, 12:48:22 PM »

can you elaborate the formula parts with explicit code examples ?
wohoo, a new formula!!!

Here it is, I copypasted from his link wink wink wink

Code:
// Tslil 'Hiato' Clingman, 2012
#include "2D.frag"
#group mandelex

uniform float linear_a; slider[0.1,2,10];
uniform float linear_b; slider[0.1,2,10];
uniform float wrap; slider[0.1,0.5,10]
uniform float radius; slider[0.1,0.5,10];
uniform float scale; slider[1,2,10];
uniform float angle; slider[0,180,360];

uniform int iters; slider[1,13,500];
uniform float bailout; slider[1,13,1000];

void wrapb(inout float a, in float w) {
if (a>w) {
a=2*w-a;
} else if (a<-w) {
a=-2*w-a;
};
};

void wrapBox(inout vec2 a, float h, float w) {
wrapb(a.x,w);
wrapb(a.y,h);
};

void wrapCirc(inout vec2 p, float r) {
  float l = length(p);
  vec2 u = p/l;
  if (l>r) p=2*r*u-p;
};

void rotate(inout vec2 a, in float phi) {
a = vec2(a.x*cos(phi)-a.y*sin(phi),a.x*sin(phi)+a.y*cos(phi));
};

void absv(inout vec2 a) {
a.x = abs(a.x);
a.y = abs(a.y);
};

void circInvert(inout vec2 p, in float r) {
float l = length(p);
if (l<r) p*=r*r/(l*l);
};


void linearPull(inout vec2 p, float h, float w) {
if (abs(p.x)>w&&abs(p.y)>h) {
h*=2; w*=2;
if (p.x<0) p.x+=w;
else p.x-=w;
if (p.y<0) p.y+=h;
else p.y-=h;
}
};

void nonlinearPull(inout vec2 p, float h, float w) {
if (abs(p.x)>w&&abs(p.y)>h) {
h*=2; w*=2;
if (p.x>0) p.x-=w*floor(p.x/w);
else p.x-=w*ceil(p.x/w);
if (p.y>0) p.y-=h*floor(p.y/h);
else p.y-=h*ceil(p.y/h);
};
};

vec2 formula(in vec2 a, in vec2 p) {
linearPull(a,linear_b,linear_b);
if (abs(p.x)<linear_a&&abs(p.y)<linear_a)
nonlinearPull(a,linear_a,linear_a);
wrapBox(a,wrap,wrap);
circInvert(a,radius);
a*=scale;
rotate(a,angle/180*3.1415926);
a+=p;
linearPull(a,linear_b,linear_b);
  return a;
}

vec3 color(in vec2 p) {
vec2 c = p;
int k=-1;
while (k<iters) {
if (length(p)>bailout) break;
p = formula(p,c);
k+=1;
};
float v = k/(iters+0.0);
v*=v*v;
return vec3(v,v,v);
};


#preset default
Center = 0,0
Zoom = 0.12359
AntiAliasScale = 1
AntiAlias = 3
linear_a = 2
linear_b = 2
wrap = 0.5
radius = 0.5
scale = 2
angle = 180
iters = 25
bailout = 500
#endpreset
Logged

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


formerly known as 'Trifox'


WWW
« Reply #5 on: December 29, 2012, 01:48:38 PM »

ah, just watched the pics, here is a fragmentarium file with parameters extended to vec2 and bigger range to allow negative scales, negative values work as well wink

* mandelex_2dimensional.frag (2.17 KB - downloaded 181 times.)
Logged

---

divide and conquer - iterate and rule - chaos is No random!
Hiato
Forums Freshman
**
Posts: 14


« Reply #6 on: December 29, 2012, 05:02:24 PM »

Thanks for the positive response all, much appreciated  afro

Kali: Wow, nice Julia find, what are the coordinates/params for that one?

cKleinhuis: heh, the negative values of scale (around -2) make for some really interesting architecture, cool idea  Azn

EDIT: Here's what I'm talking about (wrap=0.25, scale=-2, others are unchanged):

« Last Edit: December 29, 2012, 05:14:18 PM by Hiato » Logged
matsoljare
Fractal Lover
**
Posts: 215



WWW
« Reply #7 on: December 29, 2012, 10:28:46 PM »

How about a height map?
Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #8 on: December 29, 2012, 11:00:55 PM »

this is going to make an awesome 3d object, i am unsure how to fiddle the 3d rendering without de estimators,
syntopia had somewhere a script for brute force raymarching, but it is not included in the examples of the program sad
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 #9 on: December 30, 2012, 12:00:27 AM »

critical question...
If it has discontinuities, it gives trouble , So is it continue or not?
Logged

No sweat, guardian of wisdom!
Hiato
Forums Freshman
**
Posts: 14


« Reply #10 on: December 30, 2012, 01:43:17 AM »

DarkBeam: hmm, yeah, I thought about his a little and it doesn't seem to be continuous - linearpull essentially cuts space and shifts a chunk. Bleh, ah well.

cKleinhuis : I'll give that a stab on the morrow, I recall reading his blog post on the matter.
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #11 on: December 30, 2012, 03:03:58 AM »

this is going to make an awesome 3d object, i am unsure how to fiddle the 3d rendering without de estimators,
syntopia had somewhere a script for brute force raymarching, but it is not included in the examples of the program sad


Buddhi's/my method of delta DE should work OK - if not just using the magnitudes then using the smooth iteration counts.
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #12 on: December 30, 2012, 03:22:49 AM »

is it included in the default examples or what would you suggest is the easiest method to get non de rendering working !??!
Logged

---

divide and conquer - iterate and rule - chaos is No random!
kram1032
Fractal Senior
******
Posts: 1863


« Reply #13 on: December 30, 2012, 10:13:23 AM »

very beautiful cross-sections. smiley
Logged
Hiato
Forums Freshman
**
Posts: 14


« Reply #14 on: December 30, 2012, 02:05:51 PM »

Ladies and Gents, here is a quick preview of the first 3D render of this beast cheesy

EDIT: Here is the script I used to get these renders (I have intentionally turned DOWN the ray count so that you don't get bombed by running it for the first time) http://hiato.uctleg.net/mandelex/mx3d.frag -- There are some serious issue with iteration counts, set it much above 15 and you get foam, perhaps a DE might solve this, I'm not sure.



and a second (it's pretty tricky to do renders, the lines are an artefact of the image combination process, Syntopia?)



There are still many things to work out though: rotations in 3D are not as simple as in 2D and so I'm not sure what 'good' paramaters are; it would seem that half of the faces of the cube are fairly plain, while the others are not; the detail is not the same as the 2D version at all ...

Anyway, I'll update with a script once it's stable (this was done using Syntopia's wonderful brute force raytracer afro )
« Last Edit: December 30, 2012, 02:38:02 PM by Hiato » Logged
Pages: [1] 2 3 ... 6   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Demoscene - seemingly fractal inspired Demo Other Artforms aluminumstudios 1 1804 Last post November 10, 2010, 01:45:22 AM
by silencefreedom
Is there anyway to generate the Mandelex in M3D? Mandelbulb 3d bruceatsr44 4 1204 Last post March 11, 2013, 04:17:46 PM
by Alef
the Engineers - prometheus inspired fractal Movies Showcase (Rate My Movie) brasnacte 1 630 Last post June 05, 2014, 09:51:07 PM
by Mrz00m
FREE DOWNLOAD - Refraktal EP - music inspired by fractal art Other Artforms refraktal 0 887 Last post August 01, 2015, 08:53:51 AM
by refraktal
shadertoy kalibox inspired simple fractal Fractal News across the World cKleinhuis 0 684 Last post August 26, 2015, 05:09:32 AM
by cKleinhuis

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.116 seconds with 28 queries. (Pretty URLs adds 0.008s, 2q)