POV-Ray : Newsgroups : povray.unofficial.patches : #if within statements. A bug? : Re: #if within statements. A bug? Server Time
2 Nov 2024 11:24:59 EDT (-0400)
  Re: #if within statements. A bug?  
From: Juha Leppälä
Date: 21 Oct 1999 16:04:32
Message: <380F805F.76228F79@kolumbus.fi>
omniVERSE wrote:
> 
> When something doesn't work like I want I usually work around it, just
> thought I'd ask what others thought and see if I'm doing things right in the
> first place.
> When a '#if' or '#switch' directive (others possibly?) is applied within a
> 'pigment' or 'finish' statement for example, the parser errors on it.  The
> same thing is apparently okay in official POV 3.1g yet not so in 3.1e
> (UVPov, Super Patch).
> Like:
> 
> object {TestIf
>  pigment {
>   #if (DoThis)
>    rgb<1,1,1>
>   #else
>    rgb<0,0,0>
>   #end
>  }
>  finish {ambient .1
>   #if (DoThis)
>    diffuse .6
>   #else
>    diffuse 0
>   #end
>  }
> }
> 

I had no problem parsing the following in Superpatch
//Start code
#declare Test=0;
sphere { 0,1 pigment { #if(Test) rgb <1,0,1> #else rgb <0,1,0> #end } }
// End code

Maybe you haven't declared DoThis or TestIf.



Post a reply to this message

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