|
|
Am 05.04.2018 um 17:57 schrieb Sven Littkowski:
> Thanks. Yes, I assumed that there are many errors in my function. But I
> am still not sure, how to develop a code that does what I need to be done.
You can't do it with a function, because `rand()` cannot be called from
within a function.
However, since you're only using it to generate a scene (as opposed to
using it for something where it would have to be evaluated during
rendering, such asn in an isosurfaces or function pattern), the good
news is that you don't need a function anyway - a macro will do nicely.
For example, to define a "pseudo-function" that gives you a random
number in a specific range, you might use:
#declare MySeed = seed(4711);
#macro MyRand(Min,Max)
// compute stuff
#local Rand = rand(MySeed);
#local Result = Min + (Max-Min)*Rand;
// "return" the computed value
Result
#end
Post a reply to this message
|
|