POV-Ray : Newsgroups : povray.beta-test : Incorrect detection of seperators in vectors Server Time
2 Nov 2024 07:26:18 EDT (-0400)
  Incorrect detection of seperators in vectors (Message 1 to 5 of 5)  
From: Kevin Ellis
Subject: Incorrect detection of seperators in vectors
Date: 16 Jan 2002 14:44:00
Message: <3c45d800$1@news.povray.org>
Windows seems to detect a . (full stop) as a , (comma) in a vector if you
give it an invalid number, e.g <1,1,0.0.5> I think this used to give the
warning 'strange expression after rgb' or something of the sort in 3.1,
sorry can't check it (no 3.1 anymore).
Try the following two scenes with the different rgb statements:

Also notice how (in windows anyway) the editor interprets every other full
stop differently (first '.' green i.e. number, second '.' black i.e. text)

POV 3.5.beta.10.icl.win32
Windows 98
Athlon 1.333GHz
512 MB ram

Kev

//Scene start here

#declare TestScene=1; // 1 for 3d vectors or 2 for 2d vectors

#if(TestScene=1)
box {
  -1,1
  pigment {
    //rgb <1,1,0.5> //solid yellow as expected
    rgb <1,1,0.0.5> //partially transparent yellow (should give error)
    //rgb <1,1,0.0.0.5> //solid yellow (should give error)
    //rgb <1,1,0.0.0.0.5> //partially transparent yellow (should give error)
for this and all that follow
  }
}
#end
#if(TestScene=2)
box {
  -1,1
  pigment {
    //rgb <1,0.5> // solid orange
    rgb <1,0.0.5> // solid magenta
    //rgb <1,0.0.0.5> // partially transparent red
    //rgb <1,0.0.0.0.5> // partially filtered red
    //rgb <1,0.0.0.0.5> // partially transparent red and for all others

  }
}
#end
camera {location -4*z look_at 0}
plane {y,-1.001 pigment {green 1}}
light_source {<10000,10000,-10000> color rgb 1}

//Scene end here


Post a reply to this message

From: Kevin Ellis
Subject: Re: Incorrect detection of seperators in vectors
Date: 16 Jan 2002 15:40:59
Message: <3c45e55b$1@news.povray.org>
"Kevin Ellis" <kev### [at] tiscalicouk> wrote in message
news:3c45d800$1@news.povray.org...
> Windows seems to detect a . (full stop) as a , (comma) in a vector if you

I did of course mean 'POV seems to detect............', oops, sorry.

Kev


Post a reply to this message

From: Coridon Henshaw
Subject: Re: Incorrect detection of seperators in vectors
Date: 16 Jan 2002 17:05:52
Message: <Xns9198ADEDF503ACQ@204.213.191.226>
"Kevin Ellis" <kev### [at] tiscalicouk> wrote in
news:3c45d800$1@news.povray.org: 

> Windows seems to detect a . (full stop) as a , (comma) in a vector if
> you give it an invalid number, e.g <1,1,0.0.5> I think this used to
> give the warning 'strange expression after rgb' or something of the
> sort in 3.1, sorry can't check it (no 3.1 anymore).

Partially confirmed.

All of the nonstandard vectors in your scene did parse, but the end results 
were frequently different from the descriptions given in your comments.


Post a reply to this message

From: Mark Wagner
Subject: Re: Incorrect detection of seperators in vectors
Date: 17 Jan 2002 01:39:32
Message: <3c4671a4$1@news.povray.org>
Kevin Ellis wrote in message <3c45d800$1@news.povray.org>...
>Windows seems to detect a . (full stop) as a , (comma) in a vector if you
>give it an invalid number, e.g <1,1,0.0.5> I think this used to give the
>warning 'strange expression after rgb' or something of the sort in 3.1,


This is a side effect of the fact that commas are optional almost
everywhere.  What happens in the <1,1,0.0.5> case is:
Pov finds the "<" and decides that you are providing a vector
Pov finds the "1," and interprets it as the first component of the vector
Pov finds the next "1," and interpretes it as the second component of the
vector
Pov finds the "0.0.", and since a number can't contain two decimal places,
it interprets it as "0.0", the third component of the vector
Pov finds the ".5", and interprets it as the fourth component of the vector
Pov finds the ">" and decides that that is all there is to the vector
The result is that <1,1,0.0.5> is interpreted as the four-dimensional vector
<1 1 0.0 .5>

--
Mark


Post a reply to this message

From: Warp
Subject: Re: Incorrect detection of seperators in vectors
Date: 17 Jan 2002 07:34:49
Message: <3c46c4e9@news.povray.org>
Kevin Ellis <kev### [at] tiscalicouk> wrote:
: Windows seems to detect a . (full stop) as a , (comma) in a vector if you
: give it an invalid number, e.g <1,1,0.0.5>

  As Mark said, that's not an invalid number from the point of view of the
parser.
  The parser sees that in the same way as <1,1,0.0,.5>.

  (This is a trick commonly used in pov-signatures to reduce its size.)

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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