|
![](/i/fill.gif) |
Actually, it might make more sense in explaining that macro to insert a value as
in:
#macro testfinish(V) finish {ambient V} #end
That way, you could change the value (V) when calling the macro, like so:
testfinish(.7)
-- Dave
>
"wealthychef" <nomail@nomail> wrote:
> "Tim Attwood" <tim### [at] comcast net> wrote:
> > > Care to expand on that a little? Why wouldn't it work? What is going
> > > on?
> > > Clue, please. :-)
> >
> > POV finds a finish identifier, not a finish statement,
> > identifiers and statements aren't interchangeable.
> > It expects usage like ...
> >
> > #declare testfinish = finish {ambient 0.7};
> >
> > triangle {
> > v0, v1, v2
> > texture {
> > pigment { Red }
> > finish { testfinish }
> > }
> > }
> >
> > Declare statements shouldn't be confused with macros.
> > A macro substitutes the lines directly into the calling
> > code instead of using identifiers. Example...
> >
> > #macro testfinish() finish {ambient 0.7} #end
> >
> > triangle {
> > v0, v1, v2
> > texture {
> > pigment { Red }
> > testfinish()
> > }
> > }
> >
> > Here testfinish() is replaced by "finish {ambient 0.7}"
> > which is a finish statement instead of a finish identifier.
>
> thank you. This point has been confusing me for years about Povray, as I only
> occasionally dabble in it. So it seems as though in a #declare statement, the
> "finish {ambient 0.7}" piece is somehow compiled (?) into a "finish
> identifier?" What is the difference between an identifier and a statement?
> Is this true: "finish" is to "identifier" in Povray as "integer" is to
> "variable" in C?
> Aha! I think I get it:
>
> If I were to say
> #declare testtexture texture { pigment {Red} finish {ambient 0.7} };
>
> I then use it like this:
>
> triangle {
> v0,v1,v2
> texture {testtexture}
> }
>
> Thank you. It's interesting and revealing.
Post a reply to this message
|
![](/i/fill.gif) |