POV-Ray : Newsgroups : povray.binaries.images : height function maths help : height function maths help Server Time
15 Aug 2024 18:11:23 EDT (-0400)
  height function maths help  
From: James Taylor
Date: 13 May 2002 17:42:41
Message: <3ce03351@news.povray.org>
This one's had me stumped for a few weeks...

I'm trying to get the amplitude of the ripples to decay in both the x and z
directions. In the attached image, I've only achieved the decay in the
x-direction. (and growth in the z?)

It's probably something really simple that I've 'overlooked'...

Here's the code I'm using:
//pov code
#declare k = 2;
#declare h1 = 1/2;
#declare pos1 = <1/8,0,1/8>;

#declare fn_1 =
    function {
        pattern {
            ripples
            frequency 0.75
            scale 0.1
            translate <pos1.x,1-pos1.z,pos1.y>
        }
    }

#declare fn_water = function { h1*( fn_1(x,y,0)*exp(-k*x) ) }

height_field {
    function 400,400 {fn_water(x,y,0)*0.25 + 0.5}
    smooth
    pigment {Red}
    }
//end code

thanks
jim


Post a reply to this message


Attachments:
Download 'hf_new.png' (36 KB)

Preview of image 'hf_new.png'
hf_new.png


 

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