Logo by mjk1093 - 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 24, 2024, 04:23:26 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   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: Infinite staircase DE  (Read 931 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: February 05, 2015, 06:35:41 PM »

 grin Yeah this is totally crazy but fun result, a helicoidal staircase that goes on infinitely alien

Code:
// valid for thickness << abs hstep, and hstep must be < 0
u = atan2(y,x); v = sqrt(x*x+y*y);
h2 = Hstep/2; h3 = n*Hstep;
split(u * n / twopi,intpu,fracpu);
u = fracpu *twopi/n;
z = (z-intpu*Hstep);
split(z/h3,intpz,fracpz);
z = z-intpz*h3;
DE = -u;
if (u-h2 > -z) DE = z-h2;
else if (u+h2 < -z) DE = z+h2;
DE = abs(DE) - Thick;
v = abs(v - Position);
v = abs(v - Wstep);
DE = max(DE,v);

Shown here together with his best friend, the infinite checkerboard cheesy



Oh my wink
« Last Edit: February 07, 2015, 10:58:53 AM by DarkBeam » Logged

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


« Reply #1 on: February 05, 2015, 07:52:34 PM »

Niiice!
Repeating Zooming Self-Silimilar Thumb Up, by Craig
Logged
eiffie
Guest
« Reply #2 on: February 05, 2015, 10:44:06 PM »

Nice formula and render!
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #3 on: February 06, 2015, 12:41:37 AM »

Oh I am very honored, masters of raytracing embarrass
Thanks a lot!
Just hoping I transcribed correctly, 2 days of fight to finally reveal it smiley
Logged

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


formerly known as 'Trifox'


WWW
« Reply #4 on: February 06, 2015, 12:51:54 AM »

nice, tststs no shadertoy implementation? and beside, how does this de behave when hybridised with another de ?  cheesy hehe
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 #5 on: February 07, 2015, 10:55:58 AM »

Forgot to tell ...

1. Formula is approximated! If thickness is big, some cuts will be shown, the trouble will be evident for big N values probably.

2. Hstep must be < 0

smiley
Logged

No sweat, guardian of wisdom!
subblue
Conqueror
*******
Posts: 116



WWW
« Reply #6 on: February 17, 2015, 09:24:14 PM »

Very interesting!
Can you explain some of the terms of the algorithm, for instance how are
split(.., .., ..), intpu, fracpu, intpz, fracpz defined?
Logged

www.subblue.com - a blog exploring mathematical and generative graphics
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #7 on: February 17, 2015, 10:02:55 PM »

Split should ... split a number into its int and fractional part:

Split(5.844,a,b) -> a=5 and b=0.844 smiley

Please try to implement. I don't know if I copied right...
Logged

No sweat, guardian of wisdom!
TruthSerum
Guest
« Reply #8 on: May 23, 2015, 10:17:07 PM »

Here it is in GLSL:

Code:
void split(float x, inout float a, inout float b) {
    a = floor(x);
    b = fract(x);
}

float map(vec3 p) {
    float x=p.x, y=p.z, z=p.y;
    float u, v, h2, h3, n=8.0;
    float intpu, fracpu;
    float intpz, fracpz;
    float DE;
    float Thick=0.5, Position=0.5;
    float Hstep=-1.0, Wstep=1.0;
    float twopi = 6.28318530718;
   
    // valid for thickness << abs hstep, and hstep must be < 0
    u = atan(y,x); v = sqrt(x*x+y*y);
    h2 = Hstep/2.0; h3 = n*Hstep;
    split(u * n / twopi,intpu,fracpu);
    u = fracpu *twopi/n;
    z = (z-intpu*Hstep);
    split(z/h3,intpz,fracpz);
    z = z-intpz*h3;
    DE = -u;
    if (u-h2 > -z) DE = z-h2;
    else if (u+h2 < -z) DE = z+h2;
    DE = abs(DE) - Thick;
    v = abs(v - Position);
    v = abs(v - Wstep);
    DE = max(DE,v);
    return DE;
}

Here is how I tried (and failed) to trace it:

Code:
float trace(vec3 o, vec3 r) {
    float t = 0.0;
    for (int i = 0; i < 64; ++i) {
        float d = map(o + r * t);
        if (abs(d)<3.5) break;
        t += d * 0.08;
    }
    return t;
}

Very blocky results:

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


Fragments of the fractal -like the tip of it


« Reply #9 on: May 24, 2015, 11:15:31 AM »

Thinking... cheesy
Instead of floor and frac what if you use

Void split(float x, inout float a, inout float b) {
    a = round(x);
    b = x-a;
}

Try also thickness 0.1 position 2.0

smiley

Formula isn't perfect for all combinations but should work normally. Thanks for trying
Logged

No sweat, guardian of wisdom!
TruthSerum
Guest
« Reply #10 on: May 24, 2015, 01:47:26 PM »

I tried it with these parameter changes, but I could not improve the result  undecided

FYI GLSL has only floor/fract, but not round. I implemented:

Code:
float round(float x) {
    return floor(x + 0.5);
}
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #11 on: May 25, 2015, 12:08:56 AM »

Too bad I cannot help further at this time. I am sorry. sad
Logged

No sweat, guardian of wisdom!
visual.bermarte
Fractal Fertilizer
*****
Posts: 355



« Reply #12 on: May 26, 2015, 05:37:38 PM »

Not perfect but not bad neither smiley
Logged
TruthSerum
Guest
« Reply #13 on: May 26, 2015, 05:58:22 PM »

Now to compute normals smiley
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #14 on: May 27, 2015, 12:31:28 PM »

The problem is I don't remember exactly all the details now and assembly uses some different funcs. So try to disassemble the m3f wink
The mb3d function has perfect normals and all actually. (see 1st post)
Logged

No sweat, guardian of wisdom!
Pages: [1] 2   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Geometry of Fractal Staircase? General Discussion cd.roby 4 6836 Last post June 27, 2011, 10:53:38 PM
by Tater
Nude Gorilla Ascending A Staircase Movies Showcase (Rate My Movie) Sockratease 0 891 Last post June 19, 2008, 04:08:24 PM
by Sockratease
Towards the infinite Mandelbulb3D Gallery bib 0 987 Last post April 28, 2012, 12:41:46 PM
by bib
Picasso, falling down a Staircase... Animation Brummbaer 0 1764 Last post May 30, 2012, 08:31:49 PM
by Brummbaer
Infinite Possibilities Are Infinite FractalForums.com Banner Logos Pauldelbrot 0 2979 Last post June 09, 2012, 12:24:40 PM
by Pauldelbrot

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.149 seconds with 24 queries. (Pretty URLs adds 0.012s, 2q)