POV-Ray : Newsgroups : povray.unofficial.patches : iso - ridged mf question : Re: iso - ridged mf question Server Time
1 Sep 2024 14:30:39 EDT (-0400)
  Re: iso - ridged mf question  
From: Chris Huff
Date: 12 Mar 2001 12:46:21
Message: <chrishuff-137A77.12421512032001@news.povray.org>
In article <3aacfffc$1@news.povray.org>, "Tom Melly" 
<tom### [at] tomandlucouk> wrote:

> I want a band of mountains on the horizon that drop to foothills and 
> finally a plane as z approaches 0.
> 
> #declare MountFunc = function {"ridgedMF" <1,5,3,1/3,50>}
> with
> function{ y + (MountFunc(x*z,0,z)*5)}  // (note the x*z)

Try: function {y - MountFunc(x,0,z)*5*min(0, z)}
You were multiplying the x coordinate by z, translating the function by 
an amount dependant on the distance along the x and z axis. The version 
I gave scales the values returned by the function by an amount dependant 
on the z axis, which is what I think you wanted. Also, you subtract from 
y to raise the height of the plane...your "mountains" were sinking below 
ground level, not rising above it.
The "min(0, z)" prevents "negative" mountains falling off in the -z 
direction.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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