|
![](/i/fill.gif) |
On Tue, 2 Mar 1999 21:58:41 -0000, "Rob Manley"
<rob### [at] manleys freeserve co uk> 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] manleys freeserve co uk)
>
>// 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] cwcom net
http://www.hamiltonite.mcmail.com
------------
Post a reply to this message
|
![](/i/fill.gif) |