POV-Ray : Newsgroups : povray.advanced-users : Condition in functions : Re: Condition in functions Server Time
21 Dec 2024 12:08:01 EST (-0500)
  Re: Condition in functions  
From: Alain Martel
Date: 6 Dec 2024 14:34:59
Message: <675351e3$1@news.povray.org>
Le 2024-12-06 à 13:44, Bald Eagle a écrit :
> Alain Martel <kua### [at] videotronca> wrote:
> 
>> As if() can't be used in the function of an isosurface, select() is
>> pretty much the only option.
> 
> Well, I don't think that's entirely true.
> 
> If you take advantage of the fact that expressions inside of parentheses get
> evaluated, and make use of functions like sgn, min, max, etc, then you can
> multiply terms in an equation by values that select them (multiply by 1 or -1)
> or cancel them out (multiply by 0).
> 
> So if you wanted to alternate signs, you could use a sine wave and take the sign
> of that:  sgn(sin(N))
> 
> - BW
> 

According to what I remember from a discussion here a while back :
The if() is normally evaluated at parse time. That makes it unsuitable 
to be used in an isosurface that need to evaluate it at render time.


Post a reply to this message

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