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
25 Apr 2024 17:42:08 EDT (-0400)
  Re: How to address last 2 components of 5-component vectors?  
From: Bald Eagle
Date: 7 Jul 2016 12:35:00
Message: <web.577e8433ff0686005e7df57c0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> Please see http://wiki.povray.org/content/Reference_Talk:Vector_Expressions

> x,u,red -> 1st
> y,v,green -> 2nd
> z,blue -> 3rd
> t,filter -> 4th
> transmit -> 5th

Aha!   Yes, and I forgot about .red, .green, .blue, and especially .gray  :O

Also:
[F1] help (Windows) brings me this when I search for "gray":

3.3.1.7.5 Color Operators
Color vectors may be combined in expressions the same as float or vector values.
Operations are performed on a component by component basis. For example rgb
<1.0,0.5,0.2>*0.9 evaluates the same as rgb<1.0,0.5,0.2>*<0.9,0.9,0.9> or
rgb<0.9,0.45,0.18>. Other operations are done on a similar component by
component basis.

You may use the dot operator to extract a single component from a color. Suppose
the identifier Shade was previously defined as a color. Then Shade.red is the
float value of the red component of Shade. Similarly Shade.green, Shade.blue,
Shade.filter and Shade.transmit extract the float value of the other color
components. shade.gray returns the gray value of the color vector.


Post a reply to this message

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