|
![](/i/fill.gif) |
I would like to make a macro that visualises mathematical functions.
Something like this would be nice.
#macro MyFunc(Length,Formula)
#local N=0;
#while (N<=Length)
sphere { 0, 0.02
pigment { rgb <N,0,N*-1+1> }
translate <N,Formula,0>
}
#local N=N+0.1;
#end
#end
But as you might see this is of little use.
If this is to become usefull you have to be able to use it like this:
MyFunc(N*N)
In other words, you will have to be able to refere to the local N when you
call it, but it hasnt been defined yet.
If you try to define it before you call the macro it will calculate the
value before passing it into the macro.
Do I make any sense?
Is there any way you could get around this limitation?
Robb
Post a reply to this message
|
![](/i/fill.gif) |