POV-Ray : Newsgroups : povray.newusers : Macro help, please... : Macro help, please... Server Time
6 Sep 2024 04:22:41 EDT (-0400)
  Macro help, please...  
From: Patrick Hagerty
Date: 21 Jan 1999 13:10:35
Message: <36A76E2D.C920A720@hagware.com>
I'm used to using macros in programming, but I can't seem to get the
hang of POV macros.  There seems to be some inconsistencies in how they
work.

For example:  If I choose to 'stub out' a macro and force a value
thusly..

#macro TestMacro()
  (1)
#end

... it works fine.  But, if I try to select from several values using a
switch statement thusly...

#macro TestMacro( xValue )
    #switch (xValue)
      #range (0,9)
         (0)
      #break
      #range (10, 19)
         (0.5)
      #break
      #else
         (1.0)
   #end
#end

... I get errors.

What I'm trying to do is calculate a color value [I'm using different
macros for fRed(), fGreen() and fBlue()] based upon a rotation value
(passed as xValue).  I'm using the macros in a statement like this:

    "color [rgb<fRed(xAngle), fGreen(xAngle), fBlue(xAngle)>]"

Any suggestions anyone can make would be greatly appreciated.


Patrick Hagerty
pat### [at] hagwarecom


Post a reply to this message

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