I have been really enjoying the Mandelbox renders and animations. A request from a mere observer: is it possible for anyone to put together a post with a couple of images that show the folding of the box, step by step? I have looked at the formulas but I can't figure out what's going on the way I can with the Mandelbulb. Like, could someone show how a single point is successively transformed, for one that escapes and one that doesn't?
Let's go through some iterations of (99,0,0) (gonna escape...):
1) x>1 so x=2-x (y and z values are 0, so neither less than -1 or greater than 1, nothing to do to them here)
x=-97
2) length = sqrt( (-97)^2 +0^2 +0^2)= 97
3) check if length is < minRadius.... nope (minRadius=.5 97 is not less than .5) do nothing
4) since it is not less than <minRadius check to see if it is less than <fixedRadius .... nope (fixedRadius=1 97 is not less than 1) do nothing
5) multiply all 3 values by scale (x, y and z values)
y and z are 0.... so stay 0. x=-97 scale = 2 so x= -97 * 2 = -194
6) add the initial values of the pixel to the new values:
y and z are 0... added to 0... so remain 0. initial x was 99, new x is -194, so x= 99-194= -95
7) check bailout: x^2+y^2+z^2= (-95)^2 + 0 + 0 = 9025
so if yer <--- (spelled correctly) bailout was below 9025, yer pixel escaped <--spelled exactly like "escaped", how strange.
Anyways, what happened here is what happens to any escaping pixel. Some of them need to be switched around more (lets say your bailout was 9026 and we did another couple iterations):
1) now x is <-1 so x= -2 - (-95) = 93
2) radius checks, z and y are all passed same as last iteration
3)multiply by scale x= 2 * 93 = 186
4) add in pixel value x= 186+ 99 = 285
5) do another bailout check 285^2 + 0 + 0 = 81255
So unless your bailout is insanely high, the pixel escapes <-- funny, it's still spelled like "escapes". It's weird how totally different words are spelled the same way.
Here is a pixel that stays in the system (.584,.584,.584) definitely for a few iterations:
1st iteration
Passes all tests, multiplied by scale, added to itself
(1.752, 1.752, 1.752) passes bailout (magnitude is ~9.209)
2nd iteration
all values greater than 1 so = 2- value x,y,z = -.248
length ~=.429 so less than min radius so multiply all values by 4 x,y,z = -.992
skip other length test, since it hit the first one (part of the formula)
multiply by scale of 2 x,y,z = -1.984
add initial value x,y,z= -1.4
check bailout (5.
passes
3rd iteration
all values less than 1 so value = -2 -value x,y,z= -.6
length ~= 1.03.. is not < .5 (minRadius) so check if < 1 (fixedRadius) is not so do nothing
multiply by scale of 2 x,y,z=-1.2
add in initial value x,y,z=-.616
bailout passes
4th iteration
value = -2 - value xyz= -1.384
length > .5 && 1 so do nothing && means "and" in logic speak
multiply by scale of 2 xyz = -2.768
add in initial value xyz = -2.184
bailout passes
5th iteration
value = -2 - value xyz = .184
xyz is not <-1 or >1 so do nothing || means or... but no confusion needed
length = .319 is less than min radius so * 4 xyz= .736
skip next check because we hit on the first
multiply by scale xyz=1.472
add in initial value xyz=2.056
bailout passes
6th iteration.... I've got other stuff to do.
I'll write a maxima script later, if I remember and don't get caught up in something else, that will give us pixel values after a number of iterations. Might be interesting.. I think it will be. I like patterns.