POV-Ray : Newsgroups : povray.general : Using a function in a height_field declaration : Re: Using a function in a height_field declaration Server Time
30 Apr 2024 06:25:25 EDT (-0400)
  Re: Using a function in a height_field declaration  
From: Kenneth
Date: 14 Feb 2023 12:00:00
Message: <web.63ebbdaf43a1dd889b4924336e066e29@news.povray.org>
"yesbird" <nomail@nomail> wrote:
> Yet another mystery. In following example 50 is resolution, but how to set range
> for x,z ? Only small part of surface is visible.
>
> height_field
> {
>   function 50, 50 { sin (sqrt (x*x + y*y)) / (sqrt (x*x + y*y)) }
>   smooth
>   scale <1, 0.3, 1>
>   pigment { green 0.8 }
> }

That's because the sine waves are too 'large' to see in the 1X1 height_field.

Try this function 'scaling' trick for an interesting-- if odd-looking -- result.
(I changed your light_source position to <10,4,10> to make it easier to see, and
gave the function a higher resolution):

function 200, 200 { sin (sqrt (x*x + y*y)*20) / (sqrt (x*x + y*y)*20)}

As you can see, playing around with function values can be quite fun!


Post a reply to this message

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