|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |