POV-Ray : Newsgroups : povray.binaries.images : Sky simulation : Re: Sky simulation: what is wrong with this particular code? Server Time
30 Jul 2024 10:13:00 EDT (-0400)
  Re: Sky simulation: what is wrong with this particular code?  
From: Alain
Date: 5 Jul 2013 20:17:30
Message: <51d7621a$1@news.povray.org>

>
>
> Hmmm ok, so apparently I misunderstood the POV syntax, this short piece
> of code prints X=9 whereas I assumed it would print X=10. Not sure if
> this is intended behaviour or not.
>
> // start code
>
> #macro A(B)
> #local B = B - 1;
> #end
>
> #declare X = 10;
> A(X)
> #warning concat("X = ",str(X,0,0))
>
> // end code
>
> Will fix the macro and post and update... (it's essentially normalizing
> your sun position, which you're then using the place the light source).
>

Your code develop as:
#declare X = 10;
#local X = X - 1;
In this contex, #local and #declare are synonims.

So, yes, it works as expected.

There is a difference when #local is used in an include file. In an 
include, any #local variables only exist within the include.


Post a reply to this message

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