Logo by HPDZ - 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 24, 2024, 01:39:09 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: Mandelbox size  (Read 7904 times)
Description: Formula for the mandalbox and juliabox size
0 Members and 1 Guest are viewing this topic.
knighty
Fractal Iambus
***
Posts: 819


« on: April 23, 2010, 06:00:14 PM »

Hi, (maybe you already know this)
This is the formulas I've found about the size of the mandelbox and juliabox:
For the mandelbox, when scale >1, the size is proportionnal to:
      (scale+1)/(scale-1)

Say mandelboxDE(x,y,z,scale) is the function that gives the distance estimate at (x,y,z), and:
      factor= 2 if(scale<-1) and 2*(scale+1)/(scale-1) if(scale>1)
The scaled distance estimate will be:
      mandelboxDE(x*factor,y*factor,z*factor,scale)/factor
Proceeding this way will give a mandelbox centered at te origin with size 2x2x2.

In the case of juliabox, the size is propotionnal to:
       (abs(scale)+1)/(abs(scale)-1)
Using:
       factor=2*(abs(scale)+1)/(abs(scale)-1)
Will give a juliabox which is always inside the [-1,1]^3 box if the seed value is inside the corresponding mandelbox.
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #1 on: April 23, 2010, 07:56:28 PM »

I didn't smiley

Thanks for that - but what about when you change the folding parameters (both rectangular distances and spherical radii) ?

I gave up on trying to work it out and did a sort of pre-render to get the values. I'm glad I did because I'm going to expand its usefulness so it can automagically set the appropriate step scale according to how accurate the DE is for a particular fractal (of any type, it can already suggest appropriate values for each Mandelbox/Juliabox).

Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
knighty
Fractal Iambus
***
Posts: 819


« Reply #2 on: April 23, 2010, 09:59:25 PM »


but what about when you change the folding parameters (both rectangular distances and spherical radii) ?


According to my experiments, the proportionality factor ( (scale+1)/(scale-1) ) still holds. it depends only on the scale of the mandelbox. The spherical folding don't change anything but the size change with the parameter of the box folding. If 'a' is the parameter of the box folding ( I use : if(x>a) x=2*a-x; else if(x<-a) x=-2*a-x; and so...) the scaling factor should be:
      factor= 2*a if(scale<-1) and 2*a*(scale+1)/(scale-1) if(scale>1)
in order to keep the mandelbox in the [-1,1]^3 box.


I gave up on trying to work it out and did a sort of pre-render to get the values. I'm glad I did because I'm going to expand its usefulness so it can automagically set the appropriate step scale according to how accurate the DE is for a particular fractal (of any type, it can already suggest appropriate values for each Mandelbox/Juliabox).


How do you determine the appropriate step scale? I'm curious smiley
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #3 on: April 23, 2010, 11:06:13 PM »

How do you determine the appropriate step scale? I'm curious smiley

The routine I use starts with a grid of points to get the DE for (based on initial user parameters) - the square grid is a flat plane 11 points square such that it stretches say 40*40 units and it starts 40 units from the user-specified fractal centre (normally (0,0,0)) - the grid plane being perpendicular to the line through it's initial centre and the specified fractal centre.
It calculates the DE for all points on this grid, takes the minimum value then steps a small distance in the direction from the initial grid centre to the fractal centre reducing the grid size and centring the grid (2d-wise) on the point where it found the minimum DE value last time.
It then recalculates the DE for the new set of 11*11 points and again takes the minimum. Now we have two DE values a known distance apart and (assuming that our DE calculation is correctly linear) we can work out what our correct DE scale should be.
This process is essentially repeated at steps closer and closer to the fractal, always taking the point on the grid that gives the minimum DE value as the centre of the grid for the next step and refining the scale factor. We stop when the "correct" DE value is less than the user-specified DE threshold.
Finally we assume our last value is "correct" and check values at specified distances away back along the vector which the grid travelled on i.e. we check points that are supposed to be 1e-1, 1e-2, 1e-3, 1e-4.... down to the threshold*10 and for each of these check the *maximum* error factor (values less than the "correct" distance can be ignored) which gives us a scale factor for converting our DE to an actual step value, though in practice at the moment I deliberately double the value because I haven't finished tweaking the pre-render algorithm yet, it's just WIP at the moment. (note - double the value because I use step = DE/scale).
Note that the current version uses a grid from directions +x,-x,+y,-y,+z and -z i.e it repeats the process from 6 directions.

If that's too confusing then you'd probably follow better by just looking at the code - the basic routine is the "func MJBox" near the start of my wip3D5 formula for UF.

I'm aiming to expand and refine the routine so it can get "correct" DE scales and step scale adjustments for the delta DE methods as well - and so it works with just about any fractal type.

Note that the theory behind it is that the point it settles the grid on will always be a projecting point i.e. on a convex area of the fractal, therefore it should work for the delta DE methods without contamination due to the directional nature of the delta DE.
« Last Edit: April 23, 2010, 11:23:07 PM by David Makin » Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #4 on: April 23, 2010, 11:18:06 PM »

( I use : if(x>a) x=2*a-x; else if(x<-a) x=-2*a-x; and so...)

I allow:

            if zbx>@xmax
              zbx = @xmax1 - zbx
            elseif zbx<@xmin
              zbx = @xmin1 - zbx
            endif
            if zby>@ymax
              zby = @ymax1 - zby
            elseif zby<@ymin
              zby = @ymin1 - zby
            endif
            if zbz>@zmax
              zbz = @zmax1 - zbz
            elseif zbz<@zmin
              zbz = @zmin1 - zbz
            endif

i.e. the comparison and sum need not match smiley
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
knighty
Fractal Iambus
***
Posts: 819


« Reply #5 on: April 24, 2010, 06:17:43 PM »

Thanks for the explanations. I'll also take  look at your code.
( I use : if(x>a) x=2*a-x; else if(x<-a) x=-2*a-x; and so...)

I allow:

            if zbx>@xmax
              zbx = @xmax1 - zbx
            elseif zbx<@xmin
              zbx = @xmin1 - zbx
            endif
            if zby>@ymax
              zby = @ymax1 - zby
            elseif zby<@ymin
              zby = @ymin1 - zby
            endif
            if zbz>@zmax
              zbz = @zmax1 - zbz
            elseif zbz<@zmin
              zbz = @zmin1 - zbz
            endif

i.e. the comparison and sum need not match smiley

Well, this introduces discontinuities in general. That's why I don't use it (yet).
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #6 on: April 25, 2010, 01:46:01 AM »

I should also add that I have the rectangular/spherical folding and scale in a repeat loop so that they can be applied multiple times as an overall transform before adding the constant - this also changes the box size and DE scaling, though I suspect in a defineable manner given your information.
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Attachment size Discuss Fractal Forums fractalwizz 3 1843 Last post December 15, 2009, 03:14:35 PM
by cKleinhuis
Image size in Gallery Board Rules and Guidelines « 1 2 3 » Bent-Winged Angel 30 14815 Last post July 25, 2010, 08:12:27 PM
by Lee Oliver
File size requirement/limitation for an Avatar? Discuss Fractal Forums chaos_crystal 4 4676 Last post March 01, 2011, 05:11:01 PM
by chaos_crystal
light, image size and lenord Mandelbulb 3d tomot 4 2740 Last post March 07, 2011, 03:13:49 PM
by Persistent_Aura
Render size vs. Animation size? Mandelbulb 3d Weber 3 10246 Last post September 20, 2013, 12:21:11 AM
by Sockratease

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.262 seconds with 27 queries. (Pretty URLs adds 0.01s, 2q)