|
|
> #declare Number = function(MyNumber)
> {
> #declare MyAngle = rand(NySeed)*MyNumber;
> #declare MyPositive = rand(MySeed)*1.0;
> #if(MyPositive<0.5)
> MyAngle*(+1) // no #declare and no ;
> #else
> MyAngle*(-1) // no #declare and no ;
> #end
> }
>
> rotate < 0.0, Number(1.2), 0.0 >
What you're doing is not a function, but a macro.
A function operates like this:
#declare PosOrNeg = function (N) {select(N, -1, 1)};
#declare Seed = seed(123);
#for (Num, 1, 10)
#declare N = rand (Seed)-0.5;
#debug concat( " Result = ", str(PosOrNeg(N), 3, 1), "\n")
#end
You can then incorporate that into a calculation to give you an angle multiplied
by 1 or -1.
Post a reply to this message
|
|