Logo by JosLeys - 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 the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. September 17, 2019, 09:34:17 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]   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: Continuous Boxtiling Function (Accordion+cycleshift)  (Read 817 times)
0 Members and 1 Guest are viewing this topic.
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« on: December 17, 2016, 01:00:33 AM »

  Cool for animations.

  It's continuous, so it should blend well with a variety of static (non-animated) fractals.

  Set cycleshift=0 for a component (x, y, or z) if you want to skip some calculations (don't want to use it for an axis- 0 cycleshift skips calculations on that axis).  

  There are 2 versions, one is an xyz all in one function, and one has them split up.  They are called Accordion_cycleshift and xyz_Accordion_cycleshift...  the xyz_cycleshift thing lets you shift all cycles at once.  cheesy

  https://drive.google.com/open?id=0B0EcJQ49B_yObGlXbVk4SURRdmc

    

« Last Edit: December 17, 2016, 01:39:47 AM by M Benesi » Logged

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


Fragments of the fractal -like the tip of it


« Reply #1 on: December 17, 2016, 11:35:07 AM »

How it is done Matt alien
Logged

No sweat, guardian of wisdom!
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #2 on: December 18, 2016, 01:29:35 AM »

I want to write a more symmetric version (reflected along an axis) so it can be used with polyfolds and stuff, but it's based on the following code (which is only for the x-axis!):

  uniform list (floats):   AccCycle, CycleShift, AccEnd, AccStart

Code:
float Accordion (inout vec3 z) {
float zx=z.x;
float cycle=abs(AccCycle);
if (cycle<.06) {cycle=.06;}
float i=1.0; //why did he use a float here?  :p
float cycleshift=abs(mod(CycleShift,abs(AccCycle)));
float cyclemod= (mod(abs(AccEnd-AccStart),AccCycle));
cyclemod=mod(cycle+cyclemod-cycleshift,cycle);
if ((cycle)>abs(AccEnd-AccStart)) {cycle=abs(AccEnd-AccStart);}
float rotdir=1.0;
if (AccEnd-AccStart<0.0) {
cycle=-cycle;
cyclemod=-abs(cyclemod);
cycleshift=-abs(cycleshift);
if (zx>AccStart) {
// do nothing
} else if (zx<AccStart && zx>(AccStart+cycleshift)) {
//first cycle!!!
zx=zx-(AccStart);
if (zx<(cycleshift/2.)) {
zx=cycleshift-zx+AccStart;
} else {zx+=AccStart;}
//done
}
else if (zx<(AccStart) && zx>(AccEnd-cyclemod)){
zx=zx-AccStart-cycleshift;
//i+=1.0;
rotdir*=-1;
while (zx<(cycle) && i<3000.0) {
zx-=cycle;i+=1.0;rotdir*=-1;
}
if (zx<(cycle/2.)) {
zx=cycle-zx+AccStart;//rotdir*=-1;
} else {zx+=AccStart;}
//done
}
else if (zx<(AccEnd- cyclemod)  && zx>AccEnd) {
zx=AccEnd-zx;
if (zx<cyclemod/2.0) {
zx=cyclemod-zx+AccStart;
} else {
zx=zx+AccStart;
}
}  
else if (zx<AccEnd) {
zx=zx-AccEnd+AccStart;
}
} else {    //pos section   AccEnd-AccStart >0
cycle=abs(cycle);
cyclemod=abs(cyclemod);
cycleshift=abs(cycleshift);
if (zx<AccStart) {
// do nothing
} else if (zx>AccStart  && zx<AccStart+cycleshift) {
//first cycle!!!
zx=zx-AccStart;  
if (zx>cycleshift/2.) {
zx=cycleshift-zx+AccStart;
} else {
zx+=AccStart;
}

} else if (zx>(AccStart) && zx<(AccEnd-cyclemod)){
zx=zx-AccStart-cycleshift; //i+=1.0;
rotdir*=-1;
while (zx>(cycle) && i<3000.0) {
zx-=cycle;i+=1.0;rotdir*=-1;
}
if (zx>(cycle/2.)) {
zx=cycle-zx+AccStart;//rotdir*=-1;
} else {zx+=AccStart;}
//done
}

else if (zx>(AccEnd- cyclemod)  && zx<AccEnd) {
zx=AccEnd-zx;
if (zx>cyclemod/2.0) {
zx=cyclemod-zx+AccStart;
} else {
zx=zx+AccStart;
}
//i+=floor((AccEnd-cyclemod-AccStart)/cycle)+1.0;
}  
else if (zx>AccEnd) {
zx=zx-AccEnd+AccStart;
//i+=floor((AccEnd-cyclemod-AccStart)/cycle)+2.0;
}
}

z.x=zx;



return z;
}

  This version starts at a point you pick (AccStart), then cycles (up towards the midpoint of a cycle then back down to the beginning of the cycle if you're going in a positive direction,  down towards the midpoint then back up to the beginning of the cycle if you're going in a negative direction) until you reach the end.  The cycle shift shifts the location of the cycles, so you can introduce movement, or change something around a bit.  

  I'd like to make a similar function centered at a point along an axis for a symmetric version (extends out from a central point)...  need to draw it on a piece of paper before I start coding I think.  

 
« Last Edit: December 18, 2016, 01:46:49 AM by M Benesi » Logged

quaz0r
Fractal Molossus
**
Posts: 652



« Reply #3 on: December 18, 2016, 04:37:56 AM »

it kinda looks like one of those things from the matrix
Logged
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #4 on: December 18, 2016, 08:41:23 AM »



that one show??
Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #5 on: December 19, 2016, 11:32:20 PM »

xyz_Accordion_Double is symmetric for all axes (so can be used with polyfolds if you have symmetries to use):



It's in the same directory:  https://drive.google.com/open?id=0B0EcJQ49B_yObGlXbVk4SURRdmc


  Or you can use it with other continuous functions....


« Last Edit: December 20, 2016, 10:42:47 AM by M Benesi » Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #6 on: December 21, 2016, 04:58:47 AM »

I made it weirder.  cheesy

<a href="https://www.youtube.com/v/Raw4N3l-OSs&rel=1&fs=1&hd=1" target="_blank">https://www.youtube.com/v/Raw4N3l-OSs&rel=1&fs=1&hd=1</a>

Logged

Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Continuous Conformal Mandelbrots Amazing Box, Amazing Surf and variations « 1 2 » Tglad 21 11584 Last post September 11, 2012, 01:16:06 PM
by ericruijun
Mbox.accordion Images Showcase (Rate My Fractal) visual.bermarte 0 510 Last post September 03, 2010, 09:51:36 AM
by visual.bermarte
Mbox.accordion.2 Images Showcase (Rate My Fractal) visual.bermarte 6 1284 Last post December 24, 2010, 03:55:00 AM
by visual.bermarte
continuous escape time for graph-directed IFS IFS - Iterated Function Systems claude 2 914 Last post February 06, 2017, 12:44:32 PM
by knighty
Combining continuous boxtiling with oscillating functions Mandelbulb 3d M Benesi 6 554 Last post December 22, 2016, 11:14:44 PM
by M Benesi

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