|
![](/i/fill.gif) |
> I'm trying to write a macro that randomly either returns -1 or 1. This is what I
> have:
>
> #macro randsign()
> #if (rand(HPlanet_Seed_Value) > 0.5)
> 1
> #else
> -1
> #end
> #end
>
> However, POVray stops rendering and says "All #declares of float, vector, and
> color require semi-colon ';' at end if the language version is set to 3.5 or
> higher."
>
> What am I doing wrong? Adding the semi-colon causes the scene to quit for other
> reasons.
>
>
It may depend on how you call your macro.
You can call it this way:
#declare Var= randsign();
Or edit the macro this way:
#macro randsign()
#if (rand(HPlanet_Seed_Value) > 0.5)
1;
#else
-1;
#end
#end
and sue it this way:
#declare Val= randsign()
OR, use it in some calculation:
#declare Val= randsign()* Value;
Alain
Post a reply to this message
|
![](/i/fill.gif) |