|
![](/i/fill.gif) |
Hi !
I would like to make some functions. But I found POV-Ray's functions very
limited : it seems it is not possible to use directives inside.
So I decided to use macro instead, since I want to use them once at parse time
only.
From what I had understood, the #macro works pretty much as if it replaced the
call with the content of the macro.
However, I'm trying to make macro that return a float value, so I tried
something like :
#macro MyMacro(arg)
#if (arg > 1)
5
#else
10
#end
#end
But it doesn't work...
I saw some exemples like that :
#macro MyMacro(arg)
#if (arg > 1)
#declare X=5
#else
#declare X=10
#end
#end
But it doesn't seem right, I don't like toying with global var from inside
functions like this, I feel like I could overwrite some previous val...
Is there a clean way to do this kind of things ?
Thanks :)
Post a reply to this message
|
![](/i/fill.gif) |