POV-Ray : Newsgroups : povray.text.scene-files : Passing textures to MACROs : Re: Passing textures to MACROs Server Time
28 Jul 2024 22:15:38 EDT (-0400)
  Re: Passing textures to MACROs  
From: David Wilkinson
Date: 2 Mar 1999 17:56:41
Message: <36dc6b9f.23064084@news.povray.org>
On Tue, 2 Mar 1999 21:58:41 -0000, "Rob Manley"
<rob### [at] manleysfreeservecouk> wrote:

>Hi
>
>(Pov-Ray for Windows 3.1a)
>
>I'm trying to pass a pigment (or texture, etc) to a Macro, but I can't get
>it to work. The manual seems to indicate that it should be possible. Can
>anyone tell me why the first example (below) works, but the second doesn't.
>
>I know that neither do anything very interesting, but that's not the point
>......
>
>Thanks very much
>
>Rob
>(rob### [at] manleysfreeservecouk)
>
>// Example 1
>#declare MyBox = box {<-5,0,0>,<5,0.25,4>}
>
>#macro StackBoxes ()
>        #declare Count = 0;
>        #while (Count < 5)
>                object { MyBox
>                         pigment {colour rgb <1,0,0>}
>                         translate y*0.25*Count
>                }
>                #declare Count = Count + 1;
>        #end //while
>#end //macro
>
>light_source
>{
>  0*x
>  color rgb <1,1,1>
>  translate <-20, 40, -20>
>}
>
>camera
>{
>  location  <0.0 , 5.0 ,-10.0>
>  look_at   <0.0 , 0.0 , 0.0>
>}
>
>
>background { color red 0.1 green 0.3 blue 0.8 }
>
>StackBoxes ()
>
>/*****************************************************************/
>
>//Example 2
>
>#declare MyBox = box {<-5,0,0>,<5,0.25,4>}
>
>#declare MyColour = pigment {colour rgb<1,0,0>}
>
>#macro StackBoxes (Appearance)
>        #declare Count = 0;
>        #while (Count < 5)
>                object { MyBox
>                         Appearance
>                         translate y*0.25*Count
>                }
>                #declare Count = Count + 1;
>        #end //while
>#end //macro
>
>light_source
>{
>  0*x
>  color rgb <1,1,1>
>  translate <-20, 40, -20>
>}
>
>camera
>{
>  location  <0.0 , 5.0 ,-10.0>
>  look_at   <0.0 , 0.0 , 0.0>
>}
>
>
>background { color red 0.1 green 0.3 blue 0.8 }
>
>StackBoxes (MyColour)
>
>//END
>

In the second example you are passing a pigment identifier without
stating it is a pigment.  The POV-Ray diagnostic says it all. This
works;

                object { MyBox
                         pigment { Appearance }
                         translate y*0.25*Count
                }

David
------------
dav### [at] cwcomnet
http://www.hamiltonite.mcmail.com
------------


Post a reply to this message

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