POV-Ray : Newsgroups : povray.advanced-users : Array initializer versus macros - syntax error : Re: Array initializer versus macros - syntax error Server Time
26 Jun 2024 09:14:21 EDT (-0400)
  Re: Array initializer versus macros - syntax error  
From: Warp
Date: 2 Mar 2012 14:07:32
Message: <4f511a74@news.povray.org>
Drakonis <dra### [at] gmailcom> wrote:
> I will ponder this more.  But thank you for responding and explaining that
> color_map is not the same first-class scene-object-citizen that pigment is.
> That makes sense in my programmer brain, but not in my end-user brain :-)

  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...)

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.