POV-Ray : Newsgroups : povray.general : Using a function in a height_field declaration : Re: Using a function in a height_field declaration Server Time
28 Oct 2024 04:59:23 EDT (-0400)
  Re: Using a function in a height_field declaration  
From: William F Pokorny
Date: 15 Feb 2023 06:07:17
Message: <63ecbce5$1@news.povray.org>
On 2/15/23 05:34, William F Pokorny wrote:
> Yes. Functions as used in height_fields never see called x,y values 
> outside the [0-1] range.

Forgot to plug a new povr function called f_boom() I believe should be 
in any v4.0 release.

#include "functions.inc"
#declare FnChkVals = function (x) {
     select(((x<0.0) | (x>1.0)),
         0,
         0,
         f_boom(x,2,3,4,5,6)
     )
}

height_field {
   function 500, 500 { FnChkVals(y) }
...

A little ugly in that it throws after printing six values, but it offers 
a quick way for 'users' to test values in functions. Above we're testing 
that y as seen in the HF called function is never outside the [0,1] 
range.

Bill P.


Post a reply to this message

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