POV-Ray : Newsgroups : povray.beta-test : Sign()? Conditional expression? : Re: Sign()? Conditional expression? Server Time
29 Jul 2024 10:24:01 EDT (-0400)
  Re: Sign()? Conditional expression?  
From: Thorsten Froehlich
Date: 24 May 2002 08:37:10
Message: <3cee33f6@news.povray.org>
> 1) I don't see a sign () function:  did we let a whole new release slip by
> without this addition?

For ___example___:

#macro sign(foo)
    select(foo, -1, 1)
#macro

#macro sign(foo)
    #if(foo >= 0)
        1
    #else
        -1
    #end
#end

> 2) I tried to use a conditional expression in a parametric but it didn't
> work.  They work as declared variables but not as an expression in a
> parametric

You have to be careful when using them.  they don't work like they did in
MegaPOV where they are not real conditionals but simply special versions of
min and max.

    Thorsten


Post a reply to this message

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