|
![](/i/fill.gif) |
On 12/28/2013 09:20 AM, Le_Forgeron wrote:
> Le 28/12/2013 14:41, Louis nous fit lire :
>> ...
>> According to my reasoning it should generate exactly the same sphere, using plus
>> or minus should not make any difference in this formula, it only mirrors the
>> coordinates which results in the same sphere right?
>>
>> What am I missing?
>
> The fact that the whole formula is evaluated to find the frontier of the
> shape at the value of threshold (default to 0.0).
>
> So, x*x + y*y + z*z - 1 threshold 0 is identical to x*x + y*y + z*z + 1
> threshold 2.
>
> Indeed, the simplest sphere is x*x + y*y + z*z, threshold r*r.
> (r being the radius of the sphere).
>
I'll add if you are looking for the inverse function, to mirror about
the 0.0 threshold of your first equation, the function would be :
-((x*x + y*y + z*z) - 1)
This will look like your container unless you set up your container
definition to cut across the inverted sphere. Or put your camera and
light inside the inverted sphere. However, the latter will be hard to
see as anything but a background color without noise or patterning on
the isosurface too.
Perhaps as another aid to understanding, I'll throw in that you can
create an isosurface, spherical, shell shape by setting up both your
sphere and inverted sphere function with a small offset then
intersecting the two function's slightly overlapping negative coordinate
spaces with max(). This would look like:
#declare F0 = function (x,y,z) { ((x*x+y*y+z*z)-1)-0.025 }
#declare F0_inv = function (x,y,z) { -((x*x+y*y+z*z)-1)-0.025 }
#declare F = function (x,y,z) { max(F0(x,y,z),F0_inv(x,y,z)) }
with F as the final isosurface function and the threshold at 0.0.
Bill P.
Post a reply to this message
|
![](/i/fill.gif) |