POV-Ray : Newsgroups : povray.advanced-users : Help on isosurface - distances - other stuff... : Re: Help on isosurface - distances - other stuff... Server Time
29 Jul 2024 16:23:24 EDT (-0400)
  Re: Help on isosurface - distances - other stuff...  
From: Slime
Date: 13 Nov 2001 00:25:57
Message: <3bf0aee5$1@news.povray.org>
> I only want
>    to see the parts of the surface that are directly connected to the
> sphere-function...
>
>    I have no concrete idea of how to achieve this...


All you have to do is take the noise function and evaluate it not at
<x,y,z>, but at the *normalized* version of <x,y,z> multiplied by the radius
of the sphere. That means this noise function you create will return the
same value at <1,1,1>, <3,3,3>, and <100,100,100>. The distance from the
origin won't change the value of the function.

To normalize a vector, you divide the vector by it's length.
vnormalize(<x,y,z>) = <x,y,z>/sqrt(x^2+y^2+z^2). So, here's the noise
function that you need:

#declare mynoise3d = function (x,y,z,r)
{f_noise3d(x/sqrt(x^2+y^2+z^2)*r,y/sqrt(x^2+y^2+z^2)*r,z/sqrt(x^2+y^2+z^2)*r
)}

Then just use that function instead of the regular 3d noise function, and it
should work as you expect it. The greater r is, the more detail there will
be in the noise.

> How can I now describe another function g(x,y,z) that describes for
g(...)=0
> all the
> points, that have a distance d to the the surface of f() ?

As for this, it can be very complicated. It's something that will require a
lot of math, very tough math in many cases, and may require very different
methods for different functions. For a sphere, obviously, the distance from
the surface is the length of the vector <x,y,z> minus the radius of the
sphere. For anything more complicated than that, it can get *extremely* hard
to calculate. There may be ways to approximate these functions, but they
would most likely require an algorithm, which is something povray's
function{}s can't handle. If your function contains a 3d noise or pigment
function, forget about it. My suggestion is to come up with a different way
of creating the effect you need.

- Slime
[ http://www.slimeland.com/ ]
[ http://www.slimeland.com/images/ ]


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.