POV-Ray : Newsgroups : povray.newusers : Calling a #macro gives error : Re: Calling a #macro gives error Server Time
26 Jun 2024 02:20:27 EDT (-0400)
  Re: Calling a #macro gives error  
From: Trevor G Quayle
Date: 16 Jun 2013 10:20:00
Message: <web.51bdc8e91f7bf73a11b13fda0@news.povray.org>
"gharryh" <h.a### [at] harry-arendsnl> wrote:
> For a scene i would like to include a floor.
> Therefore is modified the superellipsoid  example.
> Running this whitout the #macro and #end the schene renders perfect
>
> [code]
>   union{
>     object { Row }
>
> #while(index <= MaxRow)
>     object { Row translate x*Offset*index }
> #declare index = index + 1;
> #end
>
>     pigment { White_Marble }
>     finish { phong 1 phong_size 50 reflection .35 }
>   }
>
>   plane {
>     y, 0  //this is the grout
>     pigment { color White }
>     finish { ambient .4 diffuse .7 }
>   }
> #end
> [/code]
>
> But if i call it as a macro like object{Floor(10,10) } it produces a error at
> the plane command. It puzzles me how this is possible. Anny help is welcome.

This is because you have two separate objects, the union{} and the plane{}, in
the macro.  When you are calling it inside your object{} wrapper, it is looking
for only one, so when it reaches the second, it returns an error.

Try calling it union{Floor(10,10) } instead, or put the plane and union together
in a union{} wrapper inside the macro.

-tgq


Post a reply to this message

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