|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I don't understand something. When I use the following code:
#declare testfinish = finish {ambient 0.7}
triangle {
v0 v1 v2
texture {
pignment { color Red }
testfinish
}
}
I get this error:
File: jaime.inc Line: 94
File Context (5 lines):
v0 v1 v2
texture {
pigment { color Red }
testfinish
Parse Error: No matching } in 'texture', finish identifier found instead
But if I just switch the order of pigment and testfinish, as follows, the scene
renders as I expect:
triangle {
v0 v1 v2
texture {
testfinish
pigment { color Red }
}
}
The same is true if I don't use the #declare, but just use the finish keyword
directly:
triangle {
v0 v1 v2
texture {
pigment { color Red }
finish {ambient 0.7}
}
}
I've seen this kind of thing before and always "just make it work," but I'd love
to know what's actually happening here.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"wealthychef" <nomail@nomail> wrote in message
news:web.4828c29b90917db34a296dd40@news.povray.org...
>I don't understand something. When I use the following code:
>
> #declare testfinish = finish {ambient 0.7}
>
> triangle {
> v0 v1 v2
> texture {
> pignment { color Red }
> testfinish
> }
> }
>
> I get this error:
> File: jaime.inc Line: 94
> File Context (5 lines):
> v0 v1 v2
> texture {
> pigment { color Red }
> testfinish
> Parse Error: No matching } in 'texture', finish identifier found instead
>
> But if I just switch the order of pigment and testfinish, as follows, the
> scene
> renders as I expect:
>
> triangle {
> v0 v1 v2
> texture {
> testfinish
> pigment { color Red }
> }
> }
actually I wouldn't have expected that to work, unless testfinish is
considered a complete texture by POV-Ray.
cu!
--
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Zeger Knaepen" <zeg### [at] povplacecom> wrote:
> "wealthychef" <nomail@nomail> wrote in message
> > But if I just switch the order of pigment and testfinish, as follows, the
> > scene
> > renders as I expect:
> >
> > triangle {
> > v0 v1 v2
> > texture {
> > testfinish
> > pigment { color Red }
> > }
> > }
>
> actually I wouldn't have expected that to work, unless testfinish is
> considered a complete texture by POV-Ray.
>
> cu!
Care to expand on that a little? Why wouldn't it work? What is going on?
Clue, please. :-)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"wealthychef" <nomail@nomail> schreef in bericht
news:web.4828c29b90917db34a296dd40@news.povray.org...
>I don't understand something. When I use the following code:
>
> #declare testfinish = finish {ambient 0.7}
>
> triangle {
> v0 v1 v2
> texture {
> pignment { color Red }
> testfinish
> }
> }
>
I think this should be written as:
triangle {
v0 v1 v2
texture {
pignment { color Red }
finish {testfinish}
}
}
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Zeger Knaepen wrote:
> actually I wouldn't have expected that to work
You are correct, it is no legal syntax, but the parser is flexible enough to
accept it anyway.
Thorsten
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Tim Attwood" <tim### [at] comcastnet> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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] comcastnet> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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:
Close, testtexture is a variable, the contents of testtexture is
a finish identifier. The statement after "#declare testtexture =" is
evaluated, found to be a finish, and stored in testtexture as a
finish identifier. An identifier is most like a pointer in C...
>
> If I were to say
> #declare testtexture texture { pigment {Red} finish {ambient 0.7} };
Right, but with the "="
> I then use it like this:
>
> triangle {
> v0,v1,v2
> texture {testtexture}
> }
>
> Thank you. It's interesting and revealing.
Glad to help.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|