|
![](/i/fill.gif) |
Warp <war### [at] tag povray org> wrote:
> Did you try what Thorsten suggested, ie. declaring a local identifier
> and "returning" it from the macro? In other words, like:
>
> #macro ColorMapMacro(lineColor)
> #local ColorMap =
> color_map
> {
> [ 0.0 color rgb 0 ]
> [ 0.5 color rgb lineColor ]
> [ 1.0 color rgb 0 ]
> };
> ColorMap
> #end
>
> (Haven't tested it myself to see if it works...)
Sorry about the delay, real life keeps interrupting my render sessions! Yes, I
tried it and it did NOT fix the problem.
However, I have found a slightly less-pretty workaround, so I will be using that
for now. That is as I mentioned above, for some reason if I use explicit
initialization of each array element, it works. It is just the
auto-initialization that fails... but that means I'll have to write it this way:
// define a Macro that creates a color_map
#macro ColorMapMacro(lineColor)
color_map
{
[ 0.0 color rgb 0 ]
[ 0.5 color rgb lineColor ]
[ 1.0 color rgb 0 ]
}
#end
// declare an array of color_maps
#local ColorMapArray1 = array[3];
// now MANUALLY initialize each element
maintain :-)
#local ColorMapArray1[0] = ColorMapMacro(<1,1,0>);
#local ColorMapArray1[1] = ColorMapMacro(<1,0,1>);
#local ColorMapArray1[2] = ColorMapMacro(<0,1,1>);
But, this gets me back on my way. Thank you both for your clarifying help.
ttfn,
Eduard
Post a reply to this message
|
![](/i/fill.gif) |