POV-Ray : Newsgroups : povray.general : macro parameters : Re: macro parameters Server Time
1 Aug 2024 06:26:27 EDT (-0400)
  Re: macro parameters  
From: kurtz le pirate
Date: 12 Feb 2006 12:41:14
Message: <kurtzlepirate-50646F.18411412022006@news.povray.org>
In article <43ef3706$1@news.povray.org>,
 "Chris B" <c_b### [at] btconnectcomnospam> wrote:

> "kurtz le pirate" <kur### [at] yahoofr> wrote in message
> news:kurtzlepirate-D923AB.09321512022006@news.povray.org...
> > hi,
> >
> > i am trying to make a macro with one of parameters is "normal" like this
> > #macro foo(.., .., thisNormal, ..)
> >  ...
> >  normal { thisNormal }
> >  ...
> > #end
> >
> > ok, works fine... but in some cases i don't want normal.
> > how can i pass a "no-normal" or "empty-normal" parameters ?
> >
> > any ideas ?
> >
> > thanks.
> 
> Hi Kurtz,
> 
> I don't know how to do exactly what you ask. Just in case no-one else does 
> either, here's a work-around.
> Forgive me if it's just dodging the question, or if it's describing 
> something that's already obvious to you.
> 
> Regards,
> Chris B.
> 
> camera {location <0,0,-4> look_at <0,0,0>}
> light_source{<0,3,-10> rgb 1}
> #macro foo ()
>   cylinder {-1,1,0.5
>     texture {
>       pigment {color rgb <1,1,1>}
>       #ifdef (thisNormal) normal {thisNormal} #end
>     }
>   }
> #end
> 
> #declare thisNormal = normal {agate};
> foo()
> #undef thisNormal
> object {foo() rotate -y*90}
> #declare thisNormal = normal {marble 2 turbulence 0.5};
> object {foo() rotate y*135}

thanks chris. my english is not very good :))
but you help me. in fact, normal{} must be global's declared and not a  
parameter for the macro and, with #ifdef and #undef i can make want i 
want.

thanks too


Post a reply to this message

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