POV-Ray : Newsgroups : povray.advanced-users : Condition in functions : Re: Condition in functions Server Time
21 Dec 2024 21:33:27 EST (-0500)
  Re: Condition in functions  
From: Bald Eagle
Date: 6 Dec 2024 13:45:00
Message: <web.6753460f32068233b00a87a025979125@news.povray.org>
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


Post a reply to this message

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