|
 |
"Maetes" <nomail@nomail> wrote:
> Unfortunately, I have no idea what the functions in the script do.
> This one in particular puzzles me:
> x*x+y*y+z*z + 0.1 - hftext(x,y,z).y * 0.03
>
> Can someone help me with that?
> Is there a reasonable tutorial that explains the working of user-defined
> functions well?
> Or does anyone find the bug in the script that causes the glitches?
Do you get any messages about a max gradient and/or your isosurface may have
holes?
x*x+y*y+z*z + 0.1 - hftext(x,y,z).y * 0.03
So, the standard equation for a sphere is sqrt (x*x + y*y + z*z) - Radius = 0
What you're doing with the above equation is using the elevation of the
heightfield to modify the radius at any given point on the sphere.
and yes, your contained by object needs to be large enough to hold the entire
displaced surface, else it will get clipped.
(just curious: try adding the sqrt() around the x y z parts and see if that
helps any)
> My code used, greatly simplified:
>
> #declare hftext = function {
> pigment {
> image_map {
> png "moon_dem.png"
> map_type 1
> }
> }
> }
> #local mResult = isosurface {
> function {
> x*x+y*y+z*z + 0.1 -
> hftext(x,y,z).y * 0.03
> }
> contained_by {
> sphere {0,1}
> }
> max_gradient 10
> threshold 0.95
> //threshold 2
> texture {
> pigment {
> color rgb <0.3, 0.3, 0.3>
> }
> }
> }
>
> Thanks,
> Martin
Also look at:
https://news.povray.org/povray.binaries.images/thread/%3C5f16dc29%40news.povray.org%3E/
- BE
Post a reply to this message
|
 |