|
|
>> #macro DoCalc(pZ,pY,I,N) //function arbitrarily choosen
>> #local pY= y*cA*sin(2*pi*cFr*I/N+cFs);
>> #local pZ= z*L*I/N;
>> #end
> ...
>
> Note that this macro should (AFAIK) have no effect in any scene.
>
> If it has, then that might be a bug in the POV-Ray version you
> are using.
>
> (You are just setting 2 local variables that are "lost" right
> afterwards when the macro is exited.)
That isn't exactly right, pY and pZ are being returned by
parameter.
Unfortunately in 3.6 passing values by parameter is buggy,
it's fixed in the 3.7 beta, but in general you probably shouldn't
rely on values being returned correctly via parameter.
Typically you can either globally #declare a value to return,
or return a value by subsitution like this...
#macro DoCalcY(pZ,pY,I,N)
#local result = y*cA*sin(2*pi*cFr*I/N+cFs);
(result)
#end
#macro DoCalcZ(pZ,pY,I,N)
#local result = z*L*I/N;
(result)
#end
And call the calculations...
#local pY = DoCalcY(pZ,pY,I,N);
#local pZ = DoCalcZ(pZ,pY,I,N);
Post a reply to this message
|
|