POV-Ray : Newsgroups : povray.general : multi-segment if/else : Re: multi-segment if/else Server Time
3 Aug 2024 06:12:02 EDT (-0400)
  Re: multi-segment if/else  
From: Alain
Date: 15 Apr 2004 17:46:46
Message: <407f02c6$1@news.povray.org>
Dennis Miller nous apporta ses lumieres ainsi en ce 2004/04/15 17:34... :

>I have a scene with two planes; I want the first to appear when the clock is
>below .7 and the second when it is above .7:
>
>#if (clock <.7)
>
>plane 1 {...}
>
>#else
>
>plane 2 {...}
>
>#end
>
>But what if I wanted plane 1 when the clock was between, say 0 and .5, then
>plane 2 when it was between .5 and .7, then plane 1 to return again between
>.7 to .9, then plane 2 between .9 and 1?
>How can I do a multisegment if/else or something comparable?
>Thanks,
>Dennis
>
>  
>
you can nest #if like this:
#if (condition1)
<code>
#else
 #if(condition2)
 <code>
 #else
 .
 .
 .
 #end
#end

You can use the #switch, #case, #range and #break directives
Look at item 6.2.6.3

Alain


Post a reply to this message

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