|
|
"Kenneth" <kdw### [at] gmailcom> wrote:
> > #include "functions.inc"
> > #declare FnChkVals = function (x) {
> > select(((x<0.0) | (x>1.0)),
> > 0,
> > 0,
> > f_boom(x,2,3,4,5,6)
> > )
> > }
Kenneth, I use select all the time.
This is how it works:
select (N, -1, 0, 1)
When your comparison function gets evaluated, it returns a Boolean state (in
POV-Ray it's a 0 or a 1).
So what he's doing, is checking if x is less than 0 or greater than 1.
If it is, then the Boolean result is true, which in POV-Ray is 1.
If it's not, then the result is false, or zero.
The negative option in the select statement never gets used - it's just there to
force the select function to have a zero option that's separate from the 1
option, since a 3-term select statement is divided into 2 results: negative or
>= 0.
I hope that helps.
Post a reply to this message
|
|