|
|
Am 25.05.2017 um 15:03 schrieb stevenvh:
> I have written this macro to generate integers in [0..A[
>
> #macro RandInt(A, RS) floor(A * rand(RS) * 0.999999) #end
>
> The factor 0.999999 is to ensure A itself is excluded; rand() returns a value in
> [0..1], so including 1.
>
> When I use #debug to see the macro's return value it's fine, but when I assign
> it to a variable, like
>
> #declare somevar = RandInt(4, Rnd3);
>
> somevar will always be 0. Can anybody explain this, and how to solve it? I've
> written several similar macros which work fine.
Looks to me like your problem is somewhere else. Maybe a minimal
self-contained scene file demonstrating the problem would help.
Post a reply to this message
|
|