POV-Ray : Newsgroups : povray.general : Question on plane Syntax : Re: Question on plane Syntax Server Time
1 Aug 2024 12:25:13 EDT (-0400)
  Re: Question on plane Syntax  
From: Mike Williams
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

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