POV-Ray : Newsgroups : povray.general : macro parameters : Re: macro parameters Server Time
1 Aug 2024 06:18:22 EDT (-0400)
  Re: macro parameters  
From: Florian Siegmund
Date: 15 Feb 2006 02:55:01
Message: <web.43f2ddf6d2798c27a671bd170@news.povray.org>
kurtz le pirate <kur### [at] yahoofr> wrote:
> 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.

If you prefer your own code (with thisNormal as a non-global declared
variable), you can use it like this, too:

camera {location <0,0,-4> look_at <0,0,0>}
light_source{<0,3,-10> rgb 1}
#macro foo (thisNormal)
  cylinder {-1,1,0.5
    texture {
      pigment {color rgb <1,1,1>}
      normal {thisNormal}
    }
  }
#end

foo(normal {function {0}})

object {foo(normal {marble 2 turbulence 0.5}) rotate -y*90}
object {foo(normal {marble 2 turbulence 0.5}) rotate y*135}

// function {0} means "no normal"


Post a reply to this message

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