Logo by AGUS - 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: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. April 26, 2024, 03:17:20 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 3   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: Derivative of the Amazing fractal, or how to render it ?  (Read 8703 times)
0 Members and 1 Guest are viewing this topic.
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« on: February 18, 2010, 12:22:34 AM »

i am wondering how to calculate a DistanceEstimator value for that Amazin Fractal
http://www.fractalforums.com/3d-fractal-generation/amazing-fractal/

i am a bit stuck
Logged

---

divide and conquer - iterate and rule - chaos is No random!
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #1 on: February 18, 2010, 12:33:50 AM »

when thinking about it, a distance estimator is not an option here ?
i have to binary search the ray for intersection ?
please correct me if i am wrong  afro
Logged

---

divide and conquer - iterate and rule - chaos is No random!
Timeroot
Fractal Fertilizer
*****
Posts: 362


The pwnge.


WWW
« Reply #2 on: February 18, 2010, 01:35:12 AM »

Well, DE for the Mset is based on the Koebe 1/4 Theorem (yey 4 wikipedia!), which does not necessarily hold in the complex plane. That doesn't mean DE wouldn't work in vector space. If we have the mapping Hnc(x), we could attempt distance estimation with ln(abs(d(Hnc(x))/dc)) * abs(Hnc(x)) / abs(d(Hnc(x))/dc). The derivative of the function H with respect to c... isn't easy. d(H1c(x))/dc is one, that's simple enough, but then we use the chain rule to extend the derivative with each iteration... if we have DE_n, z_n, z_n+1 as our variables, we could calculate DE_n+1 using some pretty weird conditional hooey.

And you'd need to define multiplication of these 3D numbers.

Hehe, I wrote this post in the hope I could think of something, and I've convinced myself in the meantime that it would utterly fail  grin
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
Fractal Schemer
****
Posts: 1075



WWW
« Reply #3 on: February 18, 2010, 03:06:49 AM »

It would have to be a conditional derivative, as the function is non-continuous... but even then for:
point.x > 1
point.x = 2-point.x    which is basically   f(x) = 2 - x  which makes f ' (x) = -1  which may or may not be useful for DE. 
Logged

Timeroot
Fractal Fertilizer
*****
Posts: 362


The pwnge.


WWW
« Reply #4 on: February 18, 2010, 04:03:27 AM »

Hmm... yeah, and for the spherical inversion you'd have a derivative of 0 for radii of less than 1/2, a derivative of 1 for radii greater than 1, and -1/x^2 for radii in between. Scaling just gives a derivative of 2. So I guess if we say H(x)=M(I(C(x))) + pixel (M means magnify, I is invert, C is cube), the derivative of H(x) = C'(x)*I'(C(x))*M'(I(C(x))), which could be calculated with the following code:

loop:
 derivOld=deriv
 deriv=point.x
 if point.x > 1 || point.x < 1 then
  deriv=-1
 else
  deriv=1
 endif
%Code for folding goes here...
%Code for calculating radius goes here...
 if length<0.5
  deriv=0
 elseif length<1
  deriv=-deriv/(point.x*point.x)
 endif
%Code for spherical inversion goes here...
 deriv=deriv*2
%Code for scaling goes here...
%Code for constant addition goes here...
 deriv=deriv*derivOld+1

I think this would work. Because DE isn't really legit for 3D space, you might do something like computing separate DE's using .x, .y, and .z values and averaging them or something...  huh?
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.
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #5 on: February 18, 2010, 04:05:41 AM »

With respect to the analytical DE, it's probably better for this type of fractal to consider the analytical DE for IFS rather than standard escape-time fractals.
For affine IFS (assuming uniform scaling and no skewing) then the DE is simply:
 cabs(final magnitude)/total scale
Which actually makes sense since here "total scale" is the derivative, though quite why multiplying by log(cabs(final magnitude)) is definitely not correct in this case I'm not sure smiley
However for IFS with non-uniform scaling and/or skewing etc. then you have to get the magnitude of the determinant of the product of the transformation matrices used and of course use the correct matrix from each iteration - in the case of rendering escape-time IFS where the entire tree is traversed per point then you have to store the path of the closest route and compute the product of the matrices for that route after you've finished traversal - but in the case of the Mandelbox/Juliabox you only have one route.
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
fractalrebel
Fractal Lover
**
Posts: 211



WWW
« Reply #6 on: February 19, 2010, 10:28:37 PM »

One of the great things about UltraFractal 5 is that the architecture of the programming language allows plugins. My 3D Fractal Raytrace (UF5) was designed to handle virtually any 3D or 4D non-IFS fractal. The first plugins were for quaternion and FractInt style hypercomplex fractals, but it works with every other type I have tried. I have already prsesented some Mandelbulb examples, and now here is an Amazing Fractal example. 3D Fractal Raytrace (UF5) needs the derivative for the potential function for approaching the surface. For the Amazing Fractal I used the Delta DE potential method. DE in this context stands for DErivative, not Distance Estimate. In the Delta DE method the derivative is estimated at each iteration by adding a small delta to each of the x, y and z components and then subtracting the resultant value to get dx, dy and dz. This method works very well for the Amazing Fractal and for all other types I have tried. My other potential methods, which are often faster, require an explicit derivative calculation. I found that Timeroot's approach works reasonably well for my other potential methods.

Here is Cathedral, which uses scale = 3

Unfortunately the Ultrafractal database is down right now, and I don't know when it will be back up. I will upload the plugin for Amazing Fractal when the database is back up.


* Cathedral2.jpg (222.36 KB, 640x640 - viewed 417 times.)
Logged

cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #7 on: March 24, 2010, 06:18:34 PM »

ok, i have to ask again, about the Delta DE Method


my understanding of the algorithm for Delta DE:

z=initialzvalue
while length(z)<bailout and itercount<maxIter
   z=fractalfunc(z)
   zderive = fractalfunc(z+delta)-z ?!??!?!?huh?huh?huh??
end
Logged

---

divide and conquer - iterate and rule - chaos is No random!
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #8 on: March 24, 2010, 10:44:23 PM »

ok, i have to ask again, about the Delta DE Method


my understanding of the algorithm for Delta DE:

z=initialzvalue
while length(z)<bailout and itercount<maxIter
   z=fractalfunc(z)
   zderive = fractalfunc(z+delta)-z ?!??!?!?huh?huh?huh??
end


You missed a rather important factor (1/delta) and of course you don't add "delta" itself to z, but a vector of length delta in the appropriate direction (or directions if using Buddhi's method) i.e.  zderive = (fractalfunc(z+delta*vector)-z)/delta

Edit: correction that should be:  zderive = (fractalfunc(initialz+delta*vector)-z)/delta
« Last Edit: March 24, 2010, 11:36:16 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
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #9 on: March 24, 2010, 10:59:37 PM »

is that vector the delta from the last z value and the current one ?
or how is that vector achieved ?!?
Logged

---

divide and conquer - iterate and rule - chaos is No random!
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #10 on: March 24, 2010, 11:26:00 PM »

is that vector the delta from the last z value and the current one ?
or how is that vector achieved ?!?

The vector (or vectors) is a unit vector in an appropriate direction, exactly what depending on whether you impliment my version or Buddhi's version of the method.

In my version the vector is the unit direction vector of the viewing ray for the current pixel i.e. you iterate at position "step" on the ray and at position "step+delta". This method suffers from the same problem as my older delta DE method that uses the difference in the smooth iteration values rather than the final z value in that rays travelling parallel to the surface will produce very small zderiv values and so you have to program around this (for example using the maxdist array method that I've outlined in a number of places).

In Buddhi's version you actually use 3 unit vectors (1,0,0), (0,1,0) and (0,0,1) i.e. your four locations to iterate are "step" position (px,py,pz) plus (px+delta,py,pz), (px,py+delta,pz) and (px,py,pz+delta). From these you calculate 3 values of zderiv and combine them using zderivfinal = sqrt(zderiv1^2+zderiv2^2+zderiv3^2) (at least that's what I believe Buddhi is doing). This method avoids the directionality problems associated with using the viewing ray vector. I haven't actually implimented this myself yet as obviously this requires 4 iterations per ray step rather than just 2. I should add that an alternative to using the pythagoras is (possibly) to simply use the largest of the 3 (absolute) values of zderiv or to use the quick and dirty methods (using max,med and min) for 3D pythagoras.
« Last Edit: March 25, 2010, 12:21:15 AM 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
reesej2
Guest
« Reply #11 on: March 24, 2010, 11:41:36 PM »

Hm...can't say I've encountered this method before. I understand what you're doing to get zderive, but what is it used for? In Trifox's pseudocode, it's not actually applied.
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #12 on: March 24, 2010, 11:44:08 PM »

Hm...can't say I've encountered this method before. I understand what you're doing to get zderive, but what is it used for? In Trifox's pseudocode, it's not actually applied.

It's simply applied to get a distance estimate in place of the analytical derivative i.e.

DE = 0.5*log(cabs(z))*cabs(z)/zderiv

Note that for Buddhi's method you can avoid the triple divide by delta by calculating zderiv without using the divide and then use:

DE = 0.5*delta*log(cabs(z))*cabs(z)/zderiv

« Last Edit: March 24, 2010, 11:55:51 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 #13 on: March 25, 2010, 12:11:18 AM »

With respect to the analytical derivative for the Mandelbox can someone more maths savvy than myself please answer the question as to what is the derivative of f(x,y,z) where f(x,y,z)=(-x,y,z) or f(x,y,z)=(x,-y,z) or f(x,y,z)=(x,y,-z) as we need the derivative for the rectangular folding ?
Can we just use the obvious e.g. if the formula is say folding the x as (v-x) then we simply negate dx ?
« Last Edit: March 25, 2010, 12:16:16 AM 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 #14 on: March 25, 2010, 12:24:33 AM »

Hm...can't say I've encountered this method before. I understand what you're doing to get zderive, but what is it used for? In Trifox's pseudocode, it's not actually applied.

It's simply applied to get a distance estimate in place of the analytical derivative i.e.

DE = 0.5*log(cabs(z))*cabs(z)/zderiv

Note that for Buddhi's method you can avoid the triple divide by delta by calculating zderiv without using the divide and then use:

DE = 0.5*delta*log(cabs(z))*cabs(z)/zderiv



I should point out that that's how the delta z method is applied, my older delta DE method using the smooth iteration values is slightly different.
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] 2 3   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
My Amazing Fractal! Mandelbulb 3d Weber 3 3914 Last post March 15, 2012, 01:03:06 AM
by Weber
Amazing fractal bulb - 3D print Mandelbulb3D Gallery bib 2 2505 Last post March 06, 2013, 07:49:07 AM
by jehovajah
The Amazing Dissolving Fractal Images Showcase (Rate My Fractal) thom 0 728 Last post March 15, 2013, 10:50:22 PM
by thom
New Amazing 3D Lenticular Fractal Paintings Images Showcase (Rate My Fractal) LMarkoya 0 1522 Last post August 18, 2013, 04:21:46 PM
by LMarkoya
Amazing discovery...Fractal DNA Images Showcase (Rate My Fractal) thom 0 1650 Last post March 23, 2016, 01:22:04 AM
by thom

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.223 seconds with 24 queries. (Pretty URLs adds 0.024s, 2q)