POV-Ray : Newsgroups : povray.general : Question About Macros : Re: Question About Macros Server Time
10 Aug 2024 23:25:18 EDT (-0400)
  Re: Question About Macros  
From: Remco de Korte
Date: 14 Oct 1999 07:34:11
Message: <3805BFDB.9259B0FC@xs4all.nl>
Andrea Ryan wrote:
> 
>     Is it a good idea to include transformations in macros like:
> 
> #macro MakeBall (translatex, translatey, translatez, scalex, scaley,
> scalez, radius)
> sphere { <translatex, translatey, translatez>,radius
> scale <scalex, scaley, scalez>
> texture {...}
> }
> #end
> 
> or let others add object statements and transformations?
> Brendan Ryan

There's a limit to the amount of parameters a macro can handle (I soon found
out).
It's also not easier to work with a macro that only needs a few essential
parameters.
For instance, if a macro just declares an object you can easily scale, rotate or
translate it outside that macro by including it in an object statement, leaving
the essentials to the actual macro-declaration. To turn things round: you can
add the most redundant parameters to a macro and it will still work (in the
example of the object-macro you could add parameters declaring ground_fog,
sky_sphere etc. - of course these might also be meaningful to the macro).

If you _need_ a lot of parameters it's also an idea to pass those in an
include-file.
You could use a template-include with default values... eeh... oh well, this is
not what you asked, never mind.

Remco


Post a reply to this message

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