POV-Ray : Newsgroups : povray.general : Question on plane Syntax Server Time
31 Oct 2024 10:23:26 EDT (-0400)
  Question on plane Syntax (Message 1 to 7 of 7)  
From: Ken Hutson
Subject: Question on plane Syntax
Date: 9 Oct 2005 14:42:34
Message: <4349649a$1@news.povray.org>
The first three plane definitions pass through the parser. The fourth 
generates an error. Why?

plane{
 <0,0,1>,1
 pigment{rgb<1,1,1>}
}

plane{
 <0,0,1>
 1
 pigment{rgb<1,1,1>}
}

plane{
 <0,0,1>,-1
 pigment{rgb<1,1,1>}
}

plane{
 <0,0,1>
 -1
 pigment{rgb<1,1,1>}
}

Kenneth Hutson


Post a reply to this message

From: Mike Williams
Subject: Re: Question on plane Syntax
Date: 9 Oct 2005 14:59:59
Message: <gB37vMApiWSDFwDn@econym.demon.co.uk>
Wasn't it Ken Hutson who wrote:
>The first three plane definitions pass through the parser. The fourth 
>generates an error. Why?
>
>plane{
> <0,0,1>
> -1
> pigment{rgb<1,1,1>}
>}

In places where a vector expression is expected, "1" is considered to be
the vector <1,1,1>. So "<0,0,1> -1" means <0,0,1> - <1,1,1>, with the
"-" being interpreted a the binary minus operator rather then the unary
minus. In order to avoid this interpretation, the comma is required.

plane{ <0,0,1> 1 pigment{rgb<1,1,1>}} is OK because the 1 cannot be
parsed as part of a vector expression.

plane{ <0,0,1> +1 pigment{rgb<1,1,1>}} will fail because the 1 is parsed
as part of a vector expression, so a comma would be required.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Hasan3
Subject: Re: Question on plane Syntax
Date: 9 Oct 2005 15:05:01
Message: <web.434968689b6ef72cc8a538750@news.povray.org>
"Ken Hutson" <ken### [at] goettingcom> wrote:
> The first three plane definitions pass through the parser. The fourth
> generates an error. Why?
>
> plane{
>  <0,0,1>,1
>  pigment{rgb<1,1,1>}
> }
>
> plane{
>  <0,0,1>
>  1
>  pigment{rgb<1,1,1>}
> }
>
> plane{
>  <0,0,1>,-1
>  pigment{rgb<1,1,1>}
> }
>
> plane{
>  <0,0,1>
>  -1
>  pigment{rgb<1,1,1>}
> }
>
> Kenneth Hutson



4.plane :
You have forgotten "," : it must like that:

plane{
 <0,0,1>,
 -1
 pigment{rgb<1,1,1>}
}


Hasan...


Post a reply to this message

From: Ken Hutson
Subject: Re: Question on plane Syntax
Date: 9 Oct 2005 16:59:16
Message: <434984a4$1@news.povray.org>
Thank you sir!
Kenneth Hutson


Post a reply to this message

From: Chris B
Subject: Re: Question on plane Syntax
Date: 10 Oct 2005 04:44:48
Message: <434a2a00$1@news.povray.org>
"Hasan3" <PRO### [at] Yahoocom> wrote in message 
news:web.434968689b6ef72cc8a538750@news.povray.org...
> "Ken Hutson" <ken### [at] goettingcom> wrote:
>> The first three plane definitions pass through the parser. The fourth
>> generates an error. Why?
>>
>> plane{
>>  <0,0,1>,1
>>  pigment{rgb<1,1,1>}
>> }
>>
>> plane{
>>  <0,0,1>
>>  1
>>  pigment{rgb<1,1,1>}
>> }
>>
>> plane{
>>  <0,0,1>,-1
>>  pigment{rgb<1,1,1>}
>> }
>>
>> plane{
>>  <0,0,1>
>>  -1
>>  pigment{rgb<1,1,1>}
>> }
>>
>> Kenneth Hutson
>
>
>
> 4.plane :
> You have forgotten "," : it must like that:
>
> plane{
> <0,0,1>,
> -1
> pigment{rgb<1,1,1>}
> }
>
>
> Hasan...
>

Hasan is correct.
Just in case you're wondering why the second example works, it's because 
there's no positive or negative sign on the second parameter, so POV-Ray 
assumes it's the second parameter and is happy.
With your 4th example the minus sign is taken as a mathematical operation 
operating on the vector which evaluates to <-1,-1,0>. Then when POV-Ray 
looks for the second parameter it can't find it and complains.

Regards,
Chris B.


Post a reply to this message

From: Chris B
Subject: Re: Question on plane Syntax
Date: 10 Oct 2005 04:50:34
Message: <434a2b5a@news.povray.org>
Whoops,
I responded before all of the messages downloaded, so I didn't see that Mike 
already said that.


Post a reply to this message

From: Kenneth Hutson
Subject: Re: Question on plane Syntax
Date: 10 Oct 2005 13:29:24
Message: <434aa4f4$1@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote in message 
news:434a2b5a@news.povray.org...
> Whoops,
> I responded before all of the messages downloaded, so I didn't see that 
> Mike already said that.
>
Heh,
I was making the faulty assumption that (somehow) the hard return was 
signalling that the second paramater was ready to be passed.
Thanks Chris.


Post a reply to this message

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