POV-Ray : Newsgroups : povray.advanced-users : How to address last 2 components of 5-component vectors? : Re: How to address last 2 components of 5-component vectors? Server Time
17 May 2024 20:15:22 EDT (-0400)
  Re: How to address last 2 components of 5-component vectors?  
From: clipka
Date: 10 Jul 2016 13:04:16
Message: <57828010$1@news.povray.org>
Am 10.07.2016 um 18:21 schrieb William F Pokorny:

> The block under discussion is in the section:
> 
> http://wiki.povray.org/content?title=Reference:Color_Expressions
> 
> where we describe how a user can specify color as in:
> 
> pigment { color .... }
> 
> In this context it seems to me we care not that a 5 term vector is
> otherwise treated by POV-Ray as a color vector by default, but whether
> we need to specify the rgb... whatever string in the color
> specification. In the latter context I think what I have written is what
> happens. All these are today valid ways to specify color:
> 
> color 1           // We get white
> color <1,1>       // We get yellow
> color <1,1,1>     // White
> color <1,1,1,1>   // Clear by filter
> color <1,1,1,1,1> // Again clear

If you look at it that way, you forget

  color rgb 1
  color rgb <1,1>
  color rgb <1,1,1>
  color rgbf 1
  color rgbf <1,1>
  color rgbf <1,1,1>
  color rgbf <1,1,1,1>
  color rgbt 1
  color rgbt <1,1>
  color rgbt <1,1,1>
  color rgbt <1,1,1,1>
  color rgbft 1
  color rgbft <1,1>
  color rgbft <1,1,1>
  color rgbft <1,1,1,1>
  color rgbft <1,1,1,1,1>
  color srgb 1
  color srgb <1,1>
  color srgb <1,1,1>
  color srgbf 1
  color srgbf <1,1>
  color srgbf <1,1,1>
  color srgbf <1,1,1,1>
  color srgbt 1
  color srgbt <1,1>
  color srgbt <1,1,1>
  color srgbt <1,1,1,1>
  color srgbft 1
  color srgbft <1,1>
  color srgbft <1,1,1>
  color srgbft <1,1,1,1>
  color srgbft <1,1,1,1,1>

Also, you forget

  color rgb <1,1,1,1>
  color rgb <1,1,1,1,1>
  color rgbf <1,1,1,1,1>
  color rgbt <1,1,1,1,1>
  color srgb <1,1,1,1>
  color srgb <1,1,1,1,1>
  color srgbf <1,1,1,1,1>
  color srgbt <1,1,1,1,1>

which are also accepted (even though they raise a warning).

You don't really want to list all these special cases individually in
the syntax box for COLOR (or at least I /hope/ you don't want to ;)).

As for the factoid that "a 5 term vector is otherwise treated by POV-Ray
as a color vector by default", this is technically wrong.

The truth is that `.x`, `.y`, `.z` ect., as well as `.red`, `.green",
`.blue` etc., are all allowed for both vectors and colours, and both
colours and vectors can be used interchangeably, so the difference
between the two is pretty obscure (which is a property of POV-Ray's SDL
that I have always detested).

As for the `rgbft` being optional in a colour statement, this also does
/not/ mean that 5-term vectors are treated as colours by default.
Instead, it means that if the parser /specifically/ expects a colour, an
arbitrary vector is also legal (and is the very mechanism by which
vectors can be used in place of colours).


Post a reply to this message

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