Hi folks,
I am having trouble rendering a (hopefully) interesting 3D mandelbrot like fractal and was hoping one of you have either already rendered it or would be able to help. From what I've seen so far it looks interesting with a main bulb that is symmetrical around x,y,z but with a long spine running along the negative to positive axis (45 degrees from all 3 axis). The spine has a "rocket ship" shape as it approaches the main bulb with some intriguing branches
Here is my first attempt at a viewing by showing x,y images while slicing up through the z axis:
2D slices Here is my feeble attempt at rendering in Javascript:
Javascript Ray traceThe rocket sort of appears and disappears as the set rotates and the central spine is not visible at all. I suspect much of the set is invisible.
Also had a go with very crude 3D using three.js:
crude 3D(will take a while) I'd like to create a terrain mesh using ray tracing instead of just adding spheres. Although this will never be quite as good as a proper ray trace method it may be good for exploring.
The trouble is my IsInSet(x,y,z) function is just iterating and bailing out when max-iterations is reached or the magnitude exceeds a threshold. I
am not sure have no idea how to convert this into a DE function so I can use existing Mandelbulb rendering tools. For now I am using
(Iterations-i+.0001)/Iterations as my "distance estimator" but I suspect this cludge is why most of the rendered image is black.
The fractal is based on an extension to the complex system where all the axis are symmetrical. I know that this means they are not "proper" numbers (a*b = b*a, etc) but I thought it is the least contrived way to add another dimension while keeping the basic Mandelbrot iteration function of
Xnext = C^2 +C. This means there should be the equivalent of Julia sets that will be fun to explore!
So for complex numbers: (a*r + b*i)
i*i = -r
i*r = i
The 3D version is (a*r + b*i + c*t):
i*i = -r
t*t = -i
r*r = -t
i*r = i
i*t = t
t*r = r
The function looks like this in Javacript:
function isInSet(r,i,t){
var lr,li,lt = 0;
var cr = r;
var ci = i;
var ct = t;
var nr = r;
var ni = i;
var nt = t;
for(var i=0;i<=MaxIterations;i++){
//stash last
lr = nr;
li = ni;
lt = nt;
//3num{r,i,t}: r^2=-t, i^2=-r, t^2=-i; r*i -> i, i*t -> t, t*r ->r
//Square
nr = 2 * lr * lt - li * li;
ni = 2 * lr * li - lt * lt;
nt = 2 * li * lt - lr * lr;
//Add C
nr = nr + cr;
ni = ni + ci;
nt = nt + ct;
if(Math.sqrt(nr*nr + ni*ni + nt*nt) > EscapeValue){
break;
}
}
return i;
}
Can anyone help me with a DE function for this brand of 3D math, or point me to renderings of this set? (I am pretty sure it must have been done by someone during the Holy Grail explorations!)
I'd love to get a tool to explore and animate the Julia sets of this set.
Cheers!