POV-Ray : Newsgroups : povray.general : bug or trivial mistake ? Server Time
8 Aug 2024 01:15:14 EDT (-0400)
  bug or trivial mistake ? (Message 1 to 9 of 9)  
From: Wlodzimierz ABX Skiba
Subject: bug or trivial mistake ?
Date: 26 Apr 2001 08:17:14
Message: <3ae811ca@news.povray.org>
What is wrong with below syntax ?

#declare P=.5;
#declare C=texture{pigment{color rgb 1}finish{ambient.5}}
#declare B=texture{pigment{color rgb 0}finish{ambient 0}}
#declare A=texture{average texture_map{[(1-P) C][P B]}}
texture{gradient y texture_map{[0 B][.5 A][1 C]}}

it causes error: ] expected but undeclared identifier 'A' found instead.

noticed in POV-Ray 3.1g and MegaPOV 0.7

ABX
--
#local A="000114120001121034130151142153134064180060195"#local B=0;#macro G()
#declare B=B+1;val(substr(A,B,1))#end#local S=seed(1);light_source{10,1}blob{
threshold.6#local U=z;#local Y=0;#while(Y<15)#local E=G()*.7+.1e-3;#local V=<
3.5-G(),G()-2.5,-1>;#local X=0;#while(X<1)sphere{<12*X+rand(S)-6,Y+rand(S)-5,
-1>1,1}sphere{U+X*(V-U)+rand(S)E,.3}#local X=X+.01;#end#local U=V;#local Y=Y+
1;#end texture{pigment{rgb 1}normal{agate}}}camera{location z*8look_at 0}


Post a reply to this message

From: Warp
Subject: Re: bug or trivial mistake ?
Date: 26 Apr 2001 09:09:21
Message: <3ae81e01@news.povray.org>
Wlodzimierz ABX Skiba <abx### [at] abxartpl> wrote:
: #declare P=.5;
: #declare C=texture{pigment{color rgb 1}finish{ambient.5}}
: #declare B=texture{pigment{color rgb 0}finish{ambient 0}}
: #declare A=texture{average texture_map{[(1-P) C][P B]}}
: texture{gradient y texture_map{[0 B][.5 A][1 C]}}

: it causes error: ] expected but undeclared identifier 'A' found instead.

  The problem is that two contiguous textures define a layered texture.
So you are defining a layered texture names 'A' and you are using 'A'
inside it.

  Defining a texture alone is an error in itself anyways, so you can get rid
of both errors by defining the last line like:

#declare MyTexture = texture{gradient y texture_map{[0 B][.5 A][1 C]}}

-- 
#local D=array[6]{11117333955,7382340,3358,3900569407,970,4254934330}
#local I=0;#macro M()<mod(D[I],13)-6,mod(div(D[I],13),8)-3,10>#end
#while(I<6)cylinder{M()#local D[I]=div(D[I],104);M().1
pigment{rgb M()}}#local I=(D[I]>99?I:I+1);#end              /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: bug or trivial mistake ?
Date: 26 Apr 2001 09:12:13
Message: <slrn9eg7le.7fd.ron.parker@fwi.com>
On Thu, 26 Apr 2001 14:16:32 +0200, Wlodzimierz ABX Skiba wrote:
>#declare A=texture{average texture_map{[(1-P) C][P B]}}
>texture{gradient y texture_map{[0 B][.5 A][1 C]}}
>
>it causes error: ] expected but undeclared identifier 'A' found instead.

Ambiguity.  There's no way for POV to know that the last line isn't an
extra layer on the line before it, so as far as POV knows you're still 
declaring A.

The workaround is to put something else in between.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Ron Parker
Subject: Re: bug or trivial mistake ?
Date: 26 Apr 2001 09:13:06
Message: <slrn9eg7n4.7fd.ron.parker@fwi.com>
On 26 Apr 2001 09:09:21 -0400, Warp wrote:
>  Defining a texture alone is an error in itself anyways

Not if it's the result of a macro, or if it's inside of an object definition.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Warp
Subject: Re: bug or trivial mistake ?
Date: 26 Apr 2001 09:18:37
Message: <3ae8202c@news.povray.org>
This is one reason why semi-colons should be required in all #declares.

-- 
#local D=array[6]{11117333955,7382340,3358,3900569407,970,4254934330}
#local I=0;#macro M()<mod(D[I],13)-6,mod(div(D[I],13),8)-3,10>#end
#while(I<6)cylinder{M()#local D[I]=div(D[I],104);M().1
pigment{rgb M()}}#local I=(D[I]>99?I:I+1);#end              /*- Warp -*/


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: bug or trivial mistake ?
Date: 26 Apr 2001 09:47:05
Message: <3ae826d9@news.povray.org>
Ron Parker wrote in message ...
> On Thu, 26 Apr 2001 14:16:32 +0200, Wlodzimierz ABX Skiba wrote:
> > #declare A=texture{average texture_map{[(1-P) C][P B]}}
> > texture{gradient y texture_map{[0 B][.5 A][1 C]}}
> >
> > it causes error: ] expected but undeclared identifier 'A' found instead.
>
> Ambiguity.

Thanks, that was reason.

> The workaround is to put something else in between.


I moved declarations outside object but I agree that it could be possible write
";" after any declaration to finish it

ABX


Post a reply to this message

From: John VanSickle
Subject: Re: bug or trivial mistake ?
Date: 28 Apr 2001 01:58:55
Message: <3AEA5CFF.28BE232B@erols.com>
Warp wrote:
> 
>   This is one reason why semi-colons should be required in all
> #declares.

And why the syntax for declaring a layered texture should be altered.

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

From: Warp
Subject: Re: bug or trivial mistake ?
Date: 28 Apr 2001 12:44:28
Message: <3aeaf36c@news.povray.org>
John VanSickle <van### [at] erolscom> wrote:
: And why the syntax for declaring a layered texture should be altered.

  It doesn't have to be if semicolons are used. A semicolon would end
the declaration, period.

-- 
#local D=array[6]{11117333955,7382340,3358,3900569407,970,4254934330}
#local I=0;#macro M()<mod(D[I],13)-6,mod(div(D[I],13),8)-3,10>#end
#while(I<6)cylinder{M()#local D[I]=div(D[I],104);M().1
pigment{rgb M()}}#local I=(D[I]>99?I:I+1);#end              /*- Warp -*/


Post a reply to this message

From: Batronyx
Subject: Re: bug or trivial mistake ?
Date: 28 Apr 2001 23:05:54
Message: <3aeb8512$1@news.povray.org>
>  It doesn't have to be if semicolons are used. A semicolon would end
>the declaration, period.

or rather. . .

"It doesn't have to be if semicolons are used. A semicolon would end
the declaration, semicolon."

:D

----------------------------------------
Batronyx ^"^
bat### [at] cadronhsacom
http://www.batronyx.com
Bhuddist monk to hotdog vendor:
     "Make me one with everything."
----------------------------------------


Post a reply to this message

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