POV-Ray : Newsgroups : povray.newusers : Problem with variables : Re: Problem with variables Server Time
4 Sep 2024 16:18:17 EDT (-0400)
  Re: Problem with variables  
From: Kaveh
Date: 27 Oct 2002 08:28:25
Message: <1fkprmu.h5llq52t5zpbN%kaveh@delete_this.focalimage.com>
Johannes Dahlstrom <sad### [at] tkukoulufi> wrote:

> You could use an integer to represent the value you want to vary, like this:
> 
> #declare VaryAmbient = 1;
> #declare VaryDiffuse = 2;
> #declare VarySpecular = 3;
> 
> #declare WhichValueToVary = VaryAmbient;
> 
> #declare Variable = ... // Vary this
> 
> // ...
> finish {
>   ambient (WhichValueToVary == VaryAmbient) ? Variable : 0.1;
>   diffuse (WhichValueToVary == VaryDiffuse) ? Variable : 0.6;
>   specular (WhichValueToVary == VarySpecular) ? Variable : 1.0;
> }
> // ...

Thanks Johannes. I haven't come across this construction, and can't find
it in the manual. Can you give me a hint as to where I can find more
information on this? 

-- 
Kaveh


Post a reply to this message

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