M Benesi
|
|
« Reply #45 on: February 07, 2010, 02:23:19 AM » |
|
Hi guys, didn't feel like writing up the vector stuff so came up with this non-vector version, which I think may be the equivalent (it works.. although I haven't replicated your guys exact images, been messing with some other formulas recently).
/* fold box onto itself */ <-- ChaosPro uses /* for comments */ if (sx > 1) { //sx is what I call the x component sx = xfold - sx; //xfold is a parameter I set, you can use 2 like in tglad's OP } else if (sx<-1) { sx = 0-xfold - sx; } if (sy > 1) { //sy is the y... sy = yfold - sy; } else if (sy<-1) { sy = 0-yfold - sy; } if (sz > 1) { // guess what sz is. I dare you. sz = zfold - sz; } else if (sz<-1) { sz = 0-zfold - sz; } /*fold sphere onto itself */ length = sqrt(sx^2+sy^2+sz^2); //length is set to the "vectors" magnitude the old fashioned way if (length < minRadius) { t1=(sqr(fixedRadius)/sqr(minRadius)); //I use variable t1 here... could below as well, doesn't really matter sx=sx*t1; // Of course, since it is not a vector, you have to multiply each component sy=sy*t1; // individually... but this format has some advantages.. maybe sz=sz*t1; } else if (length < fixedRadius) { t2=(sqr(fixedRadius)/sqr(length)); //same thing here, assigned value t2 (could have used t1 again...) sx=sx*t2; //then multiply each component by it sy=sy*t2; sz=sz*t2; } if (juliaMode) { //if it's a Julia type, add the components of c to the matching components of x,y, and z sx=sx*scalef +cr; // cr is the real for sx, which is the x... ci is imaginary for y (sy).... etc. sy=sy*scalef +ci; // I also multiply the components by the scale factor before adding in the julia sz=sz*scalef +ck; // components: I use the variable scalef... } else { sx=sx*scalef +pixelr; // and this is just normal mode, not julia, add in the corresponding pixel components each time sy=sy*scalef +pixeli; // once again, multiply by your scale factor then add in your pixel component for each sz=sz*scalef +pixelk; bail=sx^2+sy^2+sz^2; // and I check against this bailout value...
I wonder how it would look with a number of iterations before adding in the pixels?
i=1; while (i<=iter) { .... i=i+1; } then add in pixel components..
Anyways, if you can follow the above, it's a non-vector equivalent, unless Tglad or someone else spots a mistake.
matt
|
|
|
Logged
|
|
|
|
kram1032
|
|
« Reply #46 on: February 07, 2010, 02:34:25 AM » |
|
oh that conditonal negative version looks like Star Wars meets Star Trek (BORG Death Star or something )
|
|
|
Logged
|
|
|
|
msltoe
Iterator
Posts: 187
|
|
« Reply #47 on: February 07, 2010, 04:24:13 AM » |
|
Matt,
I coded it up in C similarly. I think the square root can be taken out, by squaring everything in the if statements. That saves a little computational time.
-mike
|
|
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #48 on: February 07, 2010, 04:44:03 AM » |
|
Hi Mike, What about going through the iteration from the top again. I don't know if it will work with sx=sx^2. I might be missing something, but I am making some coffee to remedy that.
|
|
|
Logged
|
|
|
|
msltoe
Iterator
Posts: 187
|
|
« Reply #49 on: February 07, 2010, 05:12:42 AM » |
|
Matt,
Specifically, I was saying that the variable length = sqrt(sx^2+sy^2+sz^2). So if you define length2 = sx^2+sy^2+sz^2, then the if statement becomes "if (length2 < fixedRadius*fixedRadius)" and "t2 = fixedRadius*fixedRadius/length2", avoiding a square root calculation.
-mike
|
|
|
Logged
|
|
|
|
Timeroot
|
|
« Reply #50 on: February 07, 2010, 08:40:30 AM » |
|
Let me know if you get the ChaosPro code to work!
I've been working on the code Tglad gave, and I think I've improved it somewhat. In my version the Conformal Mandelbrot/Conformal Julia have their own option, rather than being a certain set of options to unlock them. Also, there are scale, minRadius, fixedRadius, and cubeSize parameters. (Here, cubeSize = xfold = yfold = zfold in the ChaosPro code.) I also have a check box to enable the conditional negatizing. The one thing I'm not happy with is that in the code, the Conformal formula is built more like a special kind of Mandelbulb than its own fractal. It works fine, it just will make things more confusing for the next author.
If only these things were faster. But that's the price we pay for mathematical and aesthetic appeal t
|
|
|
Logged
|
Someday, man will understand primary theory; how every aspect of our universe has come about. Then we will describe all of physics, build a complete understanding of genetic engineering, catalog all planets, and find intelligent life. And then we'll just puzzle over fractals for eternity.
|
|
|
M Benesi
|
|
« Reply #51 on: February 07, 2010, 10:50:35 AM » |
|
Thanks Mike, I see it now.
matt
<-- has a bunch of code that needs to be cleaned up, just been righting new formulas.. and more formulas.. and more...
|
|
|
Logged
|
|
|
|
David Makin
|
|
« Reply #52 on: February 07, 2010, 09:46:28 PM » |
|
An updated version of my formula is due shortly - I am just about to send a copy to Tglad and bib so bib can check that I've not broken anything and Tglad can check that my implimentation of the Mandelbox is OK. Anyway here's a test render: "A breach in the Core" If no image above then look here: http://makinmagic.deviantart.com/art/A-breach-in-the-Core-153267342
|
|
|
Logged
|
|
|
|
David Makin
|
|
« Reply #53 on: February 07, 2010, 11:24:40 PM » |
|
An updated version of my formula is due shortly - I am just about to send a copy to Tglad and bib so bib can check that I've not broken anything and Tglad can check that my implimentation of the Mandelbox is OK.
Slight delay - I decided to add negation of the triplex value when length^p<fixedradius^p but I can't get the results Jesse got here: http://www.fractalforums.com/3d-fractal-generation/amazing-fractal/msg12678/#msg12678Here's a my implimentation: k = 0 repeat x1 = real(zri) y1 = imag(zri) if x1>@xmax x1 = @xmax1 - x1 elseif x1<@xmin x1 = @xmin1 - x1 endif if y1>@ymax y1 = @ymax1 - y1 elseif y1<@ymin y1 = @ymin1 - y1 endif if zj>@zmax zj = @zmax1 - zj elseif zj<@zmin zj = @zmin1 - zj endif zri = x1 + flip(y1) magn = (|zri| + zj*zj)^(0.5*@bpwr) if magn<sqr(@minr) zri = ((sqr(@maxr)/sqr(@minr))^(0.5*@bpwr))*zri zj = ((sqr(@maxr)/sqr(@minr))^(0.5*@bpwr))*zj if @negsphere zri = -zri zj = -zj endif elseif magn<sqr(@maxr) magn = (sqr(@maxr)^(0.5*@bpwr))/magn zri = zri*magn zj = zj*magn if @negsphere zri = -zri zj = -zj endif endif zri = @scale*zri zj = @scale*zj until (k=k+1)>=@rpts zri = zri + cri zj = zj + cj The default settings are @xmax=@ymax=@zmax=1.0, @xmax1=@ymax1=@zmax1=2.0, @xmin=@ymin=@zmin=-1.0, @xmin1=@ymin1=@zmin1=-2.0, @bpwr=2.0, @minr=0.5, @maxr=1.0, @scale=2 and @rpts=1. Whenever I enable "@negsphere" I get failed normal calculations because the object appears to be made up of cantor dust fairly loosely packed so that getting a normal by limited tracing to adjacent solid doesn't work. Is something wrong with the above code ? Or do I need to impliment an alternative way of getting the normals ?
|
|
|
Logged
|
|
|
|
Jesse
Download Section
Fractal Schemer
Posts: 1013
|
|
« Reply #54 on: February 08, 2010, 12:06:51 AM » |
|
This one was made with only negating on length<fixedRadius, but not on length<minRadius. Whenever I enable "@negsphere" I get failed normal calculations because the object appears to be made up of cantor dust fairly loosely packed so that getting a normal by limited tracing to adjacent solid doesn't work. Is something wrong with the above code ? Or do I need to impliment an alternative way of getting the normals ?
Maybe averaging the smoothed iterations or the DE's over an area is the best in this case? This cubes are not easy to raytrace, i have not tested much yet, but it seems that on many flat areas the DE will be max length. My settings are DEstop of 2.4 pixel, DEstep factor of 0.05 and smoothing normals with ~8 points per direction. And limiting the max step length, according to the DEaccuracy settings.
|
|
|
Logged
|
|
|
|
David Makin
|
|
« Reply #55 on: February 08, 2010, 01:00:16 AM » |
|
This one was made with only negating on length<fixedRadius, but not on length<minRadius. Whenever I enable "@negsphere" I get failed normal calculations because the object appears to be made up of cantor dust fairly loosely packed so that getting a normal by limited tracing to adjacent solid doesn't work. Is something wrong with the above code ? Or do I need to impliment an alternative way of getting the normals ?
Maybe averaging the smoothed iterations or the DE's over an area is the best in this case? This cubes are not easy to raytrace, i have not tested much yet, but it seems that on many flat areas the DE will be max length. My settings are DEstop of 2.4 pixel, DEstep factor of 0.05 and smoothing normals with ~8 points per direction. And limiting the max step length, according to the DEaccuracy settings. Thanks, I'll try adding an alternative normal calculation for the delta DE methods.
|
|
|
Logged
|
|
|
|
bib
|
|
« Reply #56 on: February 08, 2010, 01:01:43 AM » |
|
Hi guys I am in holidays in the caribeans drinking rum and drawing fractals in the sand with my little boy. Looking fwd to doing more images with Dave's'updated formula! Cheers Bib
|
|
|
Logged
|
Between order and disorder reigns a delicious moment. (Paul Valéry)
|
|
|
David Makin
|
|
« Reply #57 on: February 08, 2010, 01:41:10 AM » |
|
OK, found an oversight in my version (forgot to add ^(0.5*@bpwr) on the compares) but it doesn't affect the problem rendering the version where the triplex is negated. Here's what I get when it's negated only when length^2<fixedradius^2 - it's obviously not just an issue with the normals - it looks nothing like Jesse's render (NB. this is using a scale of +2):
|
|
|
Logged
|
|
|
|
Jesse
Download Section
Fractal Schemer
Posts: 1013
|
|
« Reply #58 on: February 08, 2010, 12:28:31 PM » |
|
The problem is that in the negated versions, the smoothed iterations have steps. Attached are some 2D slices with color by smoothed Iterations, so in your image (@D.Makin) the DE stopped on the outer sphere, where in my image it doesnt and showed the interior, i guess.
|
|
|
Logged
|
|
|
|
David Makin
|
|
« Reply #59 on: February 08, 2010, 01:47:59 PM » |
|
The problem is that in the negated versions, the smoothed iterations have steps. Attached are some 2D slices with color by smoothed Iterations, so in your image (@D.Makin) the DE stopped on the outer sphere, where in my image it doesnt and showed the interior, i guess.
In that case how are you calculating the DE ? My formula has 2 methods available - two versions of my own smoothed iterations method and a version of Buddhi's method using: dist = scalefix*deltamin*magn1*log(magn1)/abs(magn1-magn) Where magn1 and magn are the magnitudes at step and step+deltamin. This method essentially gives the same results as the smoothed iterations method.
|
|
|
Logged
|
|
|
|
|