POV-Ray : Newsgroups : povray.general : Question About Macros : Re: Question About Macros Server Time
11 Aug 2024 05:19:51 EDT (-0400)
  Re: Question About Macros  
From: Larry Fontaine
Date: 14 Oct 1999 16:55:13
Message: <38064354.DC8753E5@isd.net>
Yes it will.
Foo(<1,4,2>,<-6,2.3,1>,<4.2,7,-1>)
In this instance . is not needed at all, you can just use "translate Trans",
but it is especially useful when you need to do things like calculate vector
lengths and angles. And if you really wanted to, you could do this:
#macro Foo(Trans ... )
 #local TransX = Trans.x;
 #local TransY = Trans.y;
 #local TransZ = Trans.z;
 translate <TransX,TransY,TransZ>
 ...
#end

Andrea Ryan wrote:

> That won't work if the object needs to be translated different distances
> along different axies.
> Brendan Ryan
>
> Peter Popov wrote:
>
> > You should take advantage of the dot "." operator. For example:
> >
> > #macro Foo (Trans, Rot, Scale) // These are all vectors
> >   #local TransZ = Trans.z;
> >   ...
> > #end
> >
> > This way you'll pass the macro three times less parameters.
> >
> > Peter Popov
> > ICQ: 15002700


Post a reply to this message

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