Logo by S Nelson - 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 18, 2024, 01:28:01 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: Way to select formula for every iteration?  (Read 3097 times)
0 Members and 1 Guest are viewing this topic.
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« on: October 23, 2015, 06:00:02 AM »

  Is there one a way to select a formula for every single iteration?

 I'd like to be able to do something like:

Iteration  Formula
1      Transform 1
2      Pine Tree_x only
3      Transform 1
4      Pine Tree
5      Transform 2
...  ...

  Or something like repeat the first couple formulas a few times, do another formula, then repeat the first couple a few more times, or whatever..

  Is there something like that already?  If not, can I look at the formula tab code so I can alter it, and submit the alterations to whoever is in charge of the project? 
Logged

mclarekin
Fractal Senior
******
Posts: 1739



« Reply #1 on: October 23, 2015, 08:31:43 AM »

It is all easy to code but  comes at a computation time cost, the trade off between function-ability and render time.

I coded a  tab  that had all the iteration start/ stop /repeat iteration flexibility for exploring, it was too slow. So I  compromised by removing the repeats  and settled for just having a single "start/stop at iteration" for each transform.

If I had the time it would be much more efficient too use a slow multi-functional set up for exploring,  then remove the unneeded flexibility  if(itr "<=>"  stuff etc., before rendering.  Definitely the best way if I was doing animations IMHO, especially if the formula requires a lot of iterations before termination conditions are met.

With your two pinetree modifications, I think they are definitely worthy of being simply coded in the order you have them, maybe just with low overhead variables of z.x = z.x + constant.x etc and z.x = z.x + (pixel.x * constantMultiplier.x) etc., for modifying the MBulb part and any other variable required for the other transforms ( I still haven’t had time to try them)

But at the same time create  a more complex set-up for exploring.

What we all need is faster computers grin







Logged
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #2 on: October 23, 2015, 06:37:57 PM »

  Faster computers... haha..  I was thinking about that while watching Don Whitaker's tutorials, trying to find a way to do this.


  The thing is, for these formulas, a lot of the variation comes from being able to combine them in certain orders, so we really have to set something up that allows us to select the formula by iteration.  I'll post some images later... but you're not going to be able to do stuff like this:



 


   if you don't have the ability to select which formula you apply to which iteration.  So far my solution, which sounds like yours, was to set iteration start points (start at iteration 5) and iteration gaps (do every 3rd iteration from start point, or whatever).  

  This doesn't give us the ability to decide that it needs one more iteration of a certain formula at a certain point though.  I'll think about it a bit, but we really need to be able to do that.
Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #3 on: October 23, 2015, 07:47:29 PM »

I coded a  tab  that had all the iteration start/ stop /repeat iteration flexibility for exploring, it was too slow. So I  compromised by removing the repeats  and settled for just having a single "start/stop at iteration" for each transform.

   Can I look at that tab??  cheesy  Maybe you (or I) could modify it, balancing speed and versatility.


  Second idea is to find where the iteration number is stored in the stack, and use that in the formulas themselves, although maybe it's better to do that in the front end before calling the formulas.  As I've no clue how M3D operates (haven't seen the code), I don't know what would be the best path to take.
Logged

thargor6
Fractal Molossus
**
Posts: 789



WWW
« Reply #4 on: October 23, 2015, 10:29:01 PM »

and submit the alterations to whoever is in charge of the project? 
I will also think about this, if you have (in the meanwhile) a solution by yourself, you can submit it to me.
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #5 on: October 23, 2015, 10:53:47 PM »

This is how your Benesi PT Transform 2 would have looked, in the old UI before I  decided to keep only one start/stop. But  imagine 15 different transforms all with multiple start/stop, i was scrolling down forever. The computation time of checking all the start & stop parameter box every iteration made things unnecessarily slow. Plus I wanted to be able to  change the variables,   so, for flexibility I inserted other copies of the transforms in the loop. If I want more complexity I could enable the hybrids tab and use three more copies of the UI, but that is slow, and I would have revert to using DELTA DE which i prefer to avoid.

Your example would look like this inside the loop, ( I haven’t actually coded TransformONE yet, I got sidetracked exploring Transform TWO grin) So my Pinetree image was just T2, PT, T2, PT, T2,  then PT for the rest of the iterations, I think in the first T2 and the first PT i only had x pixel being added.   grin.


Code:
{
//BenesiTransformONE
  benesiTransformONE3D(fractal->transform.benesiTransformONE1, z, c, i, aux);

// mandelbulb
  mandelbulbMultiTransform3D(fractal->transform.mandelbulbMulti1, z, i, aux);
  constantMultiplierTransform3D(fractal->transform.constantMultiplier1, z, c, i);

//BenesiTransformONE
  benesiTransformONE3D(fractal->transform.benesiTransformONE2, z, c, i, aux);

// mandelbulb
  mandelbulbMultiTransform3D(fractal->transform.mandelbulbMulti2, z, i, aux);
  constantMultiplierTransform3D(fractal->transform.constantMultiplier2, z, c, i);

//BenesiTransformTWO
 benesiTransformTWO3D(fractal->transform.benesiTransformTWO1, z, c, i, aux);

etc


}


* benesiPTTransform2.jpg (87.93 KB, 557x450 - viewed 216 times.)
Logged
thargor6
Fractal Molossus
**
Posts: 789



WWW
« Reply #6 on: October 23, 2015, 11:23:29 PM »

How about creating a new formula which delegates the computation to another formula(s), dependant on some rule?

E.g. by using this formula at slot 1, and having 5 more formulas, the new formula could have 5 integer params specifying the number of iterations of each slot.

Logged
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #7 on: October 23, 2015, 11:43:12 PM »

I will also think about this, if you have (in the meanwhile) a solution by yourself, you can submit it to me.

  And now I'm thinking I wish I had a way to just "thumbs up" a post.   Not familiar with Delphi, but I'll look at the source, and reply here. 

Putting this link here for convenience.

http://www.fractalforums.com/mandelbulb-3d/mandelbulb3d-source-code-t21204/   

 
Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #8 on: October 24, 2015, 12:00:23 AM »

This is how your Benesi PT Transform 2 would have looked, in the old UI before I  decided to keep only one start/stop. But  imagine 15 different transforms all with multiple start/stop, i was scrolling down forever.
eeek... yeah.  It would work, but... yeah.  I'm thinking we need to be able to assign iteration numbers to formulas, so we can just add in an iteration of another formula at some point (if we want it there at iteration 9, or something like that). 

  So we could set it up to do a couple formulas in a loop, but then put in another formula at a specific point- or find the iteration counter in M3D, and use that in the formula that you only want to use occasionally (so it is called each time, but only when iteration= certain values does it get applied), then the loop would continue. 

 @thargor6-  Would writing a formula to do that would require one to know where various things were stored in M3D's memory space?
Logged

thargor6
Fractal Molossus
**
Posts: 789



WWW
« Reply #9 on: October 24, 2015, 12:08:09 AM »

@thargor6-  Would writing a formula to do that would require one to know where various things were stored in M3D's memory space?
In each formula you have accesss to the TPIteration3D structure (or even TPIteration3Dext by an obscure cast).
Those structures are defined in https://github.com/thargor6/mb3d/blob/master/TypeDefinitions.pas

fHybrid is an array of all formulas (slots).
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #10 on: October 24, 2015, 12:57:19 AM »

For a simple dedicated Benesi fold-bulb formula UI  in Mandelbulber, I would actually contemplate using my "old type" of UI groupbox format.  We are only using three different Transforms  T1, T2 & PT (  well four for me as I make mandelbulbs in two parts, the sphere part and the add original pixel part).

I would then insert two copies of each transform, so I could  have the flexibility of having two different sets of variables (ie  plus pixel.x only  for first  PT . by setting constantMultipler : y and constantMultiplier : z to 0.0.) . As  you may only need possibly  10 iterations  (Mbulb type) to reach termination conditions,  I may only need 3 or 4 start/stop choices in each groupBox to cover all the possibilities.

 The way I build larger exploring loops  is simply  copy and paste in any transforms i want into the loop ( just a single line for each transform) and copy and paste the transform groupboxes in the same order in the UI.
So real quick.  This is hopefully eventually leading to a dynamic array "build_a _loop"  set up where you can simply drag & drop  what ever transforms you want into a  loop UI.

BTW. I really know very little  about coding (I never got past "halo whirled " in the tutorials) so I was wondering what language your code is written in. Because it was so easy with search and replace to covert to C++. grin
Logged
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #11 on: October 24, 2015, 01:24:09 AM »

thargor6!  Thank you!@#!$@   That's what I wanted from Luca.

  Had to figure out what was what by looking at the (HEX) assembly language and comparing it to formulas when I was editing them before.  Stack list is AWESOME!@$!@$!$@

   However, I can't find where the formula # is stored, and that is what I have to write to.

  I was thinking of having something similar to mclarekin's solution, but do it with a formula like you said (which might be faster than mclarekin's solution??).

1,2,3,4    repeat from 5    formula 5 takes the values from 1,2,3, or 4 and puts the value into formula 6, depending on the iteration number.  So formula 5 changes what formula is in formula 6 as the loop runs.  

  I'm going for a run to clear my head.   Thanks!
Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #12 on: October 24, 2015, 01:42:29 AM »

For a simple dedicated Benesi fold-bulb formula UI  in Mandelbulber, I would actually contemplate using my "old type" of UI groupbox format.  We are only using three different Transforms  T1, T2 & PT (  well four for me as I make mandelbulbs in two parts, the sphere part and the add original pixel part).

  Code us.  cheesy

BTW. I really know very little  about coding (I never got past "halo whirled " in the tutorials) so I was wondering what language your code is written in. Because it was so easy with search and replace to covert to C++. grin
   I think Jesse coded in Delphi... check that link I posted a few posts back (to the M3D source code thread). 
Logged

mclarekin
Fractal Senior
******
Posts: 1739



« Reply #13 on: October 24, 2015, 01:49:36 AM »

Quote
I'm thinking we need to be able to assign iteration numbers to formulas, so we can just add in an iteration of another formula at some point (if we want it there at iteration 9, or something like that).  

so here we have T2 running at iter 0,  3 ,   5 & 6 , and at 9. (I removed the pixel ("c") constantMultiplier part as I actually use a separate transform for that.)  

I can do the same with T1 and MBulb Pinetree transforms  

Note. I am assuming I actually understand what you guys are talking about  embarrass Which is not 100% true.

For fun I will make an even more flexible UI and attach to my next post.


* benesiPTTransform4.jpg (62.26 KB, 538x330 - viewed 227 times.)
Logged
thargor6
Fractal Molossus
**
Posts: 789



WWW
« Reply #14 on: October 24, 2015, 02:18:49 AM »

  However, I can't find where the formula # is stored, and that is what I have to write to.
Not sure if I understand you right, but maybe this can help, though:

This is the main loop in doHybrid():
Code:
     repeat
        Rold := Rout;
        while bTmp <= 0 do
        begin
          Inc(n);
          if n > EndTo then n := iRepeatFrom;
          bTmp := nHybrid[n] and $7FFFFFFF;
          if bTmp > 0 then PVar := fHPVar[n];
        end;
        fHybrid[n](x, y, z, w, PIteration3D);
        Dec(bTmp);
        if nHybrid[n] < 0 then Continue else
        begin
          Inc(ItResultI);
          Rout := x * x + y * y + z * z;
          if Rout < OTrap then OTrap := Rout;
        end;
      until (ItResultI >= maxIt) or (Rout > RStop);
fHybrid is an array holding the formulas and member of the TPIteration3D structure. So my basic idea was, to call fHybrid[N](x, y, z, w, PIteration3D); from fHybrid[0](x, y, z, w, PIteration3D) where you have to calculate N inside of fHybrid[0] (which is the new formula to create).
Logged
Pages: [1] 2   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
First! (iteration) Philosophy oftakofta 1 5021 Last post December 19, 2009, 11:01:43 AM
by jehovajah
Iteration fog 2 Mandelbulber Gallery Buddhi 0 1077 Last post February 12, 2012, 10:19:07 PM
by Buddhi
Iteration fog 1 Mandelbulber Gallery Buddhi 0 1295 Last post February 12, 2012, 10:19:12 PM
by Buddhi
@jesse - save formula as new formula ?! feature request cKleinhuis 0 5014 Last post October 10, 2012, 05:43:14 PM
by cKleinhuis
Terms z0 and c in the Mandelbrot/Julia Iteration Formula General Discussion « 1 2 » aleph0 16 8766 Last post August 04, 2016, 05:04:54 PM
by valera_rozuvan

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