POV-Ray : Newsgroups : povray.advanced-users : How to address last 2 components of 5-component vectors? Server Time
20 Apr 2024 02:57:57 EDT (-0400)
  How to address last 2 components of 5-component vectors? (Message 11 to 20 of 46)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Bald Eagle
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 7 Jul 2016 14:00:01
Message: <web.577e9794ff0686005e7df57c0@news.povray.org>
Please also note that is, and must be (currently) .grAy, not .grEy

> #debug concat( "Vector.gray = ", str(Vector.gray, 3, 0), "\n\n")


I'm sure these are part of the black magic that takes place in the POV-Ray
internals.  Perhaps .grEy could be added for those folks who prefer that
spelling.

Also note that "spelling" does not denote the casting of POV-Ray black magic
spells, nor does "casting" denote programmatically redefining the variable type
in the hazy and uncharted Void that is the POV-Ray SDL Parser.

Thank you.


Post a reply to this message

From: Jim Holsenback
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 7 Jul 2016 14:04:09
Message: <577e9999$1@news.povray.org>
On 7/7/2016 1:48 PM, Le_Forgeron wrote:
> I would suggest to leave "Numeric_Expressions" as it is so far, and adding, in both
"Vector_Expressions" and "Colour_Expressions", a dedicated section about getting
individual component out of a vector and colour.

OK ... that's something I can work with, thanks for the clarification :-)

> In that section, the illustration of dot item with a basic example. Such as:
>
> #declare Vector = < 1, 2, 3, 4, 5>;
> #declare First_Component_1 = Vector.red;// 1
> #declare First_Component_2 = Vector.u;// 1
> #declare First_Component_3 = Vector.x;// 1
> #declare Second_Component_1 = Vector.green;// 2
> #declare Second_Component_2 = Vector.v;// 2
> #declare Second_Component_3 = Vector.y;// 2
> #declare Third_Component_1 = Vector.blue;// 3
> #declare Third_Component_2 = Vector.z;// 3
> #declare Fourth_Component_1 = Vector.filter;// 4
> #declare Fourth_Component_2 = Vector.t;// 4
> #declare Fifth_Component = Vector.transmit;// 5
>
> (and repeat with a Colour= rgbtf <...> )
>
> The section need a visible title (visible in Table of content)
>
> // Above text was also added into the talk page. Best regards.
>


Post a reply to this message

From: Bald Eagle
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 7 Jul 2016 14:05:00
Message: <web.577e98cbff0686005e7df57c0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> Sorry to disappoint you,

Not at all - very interesting and great to learn and get a link.

Of course, while we're on the topic, can we address .hf ?
I tried Vector.hf and POV-Ray was sad and made the Founding Coders cry.
Does this need an include file of some sort to work?

Note: The .hf operator is experimental and will generate a warning.
fn_Pigm( ).gray to get the gray value of the color vector
gray value = Red*29.7% + Green*58.9% + Blue*11.4%

fn_Pigm( ).hf to get the height_field value of the color vector
hf value = (Red + Green/255)*0.996093


Post a reply to this message

From: Bald Eagle
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 7 Jul 2016 14:10:01
Message: <web.577e9a16ff0686005e7df57c0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> It is documented at least in
http://wiki.povray.org/content/Documentation:Tutorial_Section_3.2

Also,
That wiki link has incorrect information, leading an unsuspecting person to
believe that

fn_Pigm( ).x | fn_Pigm( ).u | fn_Pigm( ).red
to get the red value of the color vector
fn_Pigm( ).y | fn_Pigm( ).v | fn_Pigm( ).green
to get the green value of the color vector
fn_Pigm( ).z | fn_Pigm( ).blue
to get the blue value of the color vector
fn_Pigm( ).filter | fn_Pigm( ).f
to get the filter value of the color vector
fn_Pigm( ).transmit | fn_Pigm( ).t
to get the transmit value of the color vector

When:
there is no .f,
..t is for filter,
and .transmit is the only dot notation to access the 5th term.

Edit or delete that, or add an erratum note?


Post a reply to this message

From: Bald Eagle
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 7 Jul 2016 14:35:01
Message: <web.577e9fbaff0686005e7df57c0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> It reminds me of the house that get you mad, in Asterix (The twelve tasks of
Asterix, 8th task): To get permit A38, y
ou need the blue sheet... to get the blue sheet, you need to apply with the pink and
green ...

Well lookee here: !
The original 1976 animated film in its entirety  :)
https://www.youtube.com/watch?v=JOhRhq6Pr6g


Post a reply to this message

From: Le Forgeron
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 7 Jul 2016 14:43:53
Message: <577ea2e9$1@news.povray.org>
Le 07/07/2016 20:06, Bald Eagle a écrit :
> Le_Forgeron <jgr### [at] freefr> wrote:
> 
>> It is documented at least in
http://wiki.povray.org/content/Documentation:Tutorial_Section_3.2
> 
> Also,
> That wiki link has incorrect information, leading an unsuspecting person to
> believe that
> 
> fn_Pigm( ).x | fn_Pigm( ).u | fn_Pigm( ).red
> to get the red value of the color vector
> fn_Pigm( ).y | fn_Pigm( ).v | fn_Pigm( ).green
> to get the green value of the color vector
> fn_Pigm( ).z | fn_Pigm( ).blue
> to get the blue value of the color vector
> fn_Pigm( ).filter | fn_Pigm( ).f
> to get the filter value of the color vector
> fn_Pigm( ).transmit | fn_Pigm( ).t
> to get the transmit value of the color vector
> 
> When:
> there is no .f,
> ..t is for filter,
> and .transmit is the only dot notation to access the 5th term.
> 
> Edit or delete that, or add an erratum note?

Add a note in the talk page, at the end of it. If possible, provide also the text you
would like to see.


Post a reply to this message

From: Bald Eagle
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 7 Jul 2016 15:00:00
Message: <web.577ea5e5ff0686005e7df57c0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> Add a note in the talk page, at the end of it. If possible, provide also the text
you would like to see.

I don't have a login for the wiki pages.
I suppose I need to create an account and a login if you want me to post things
over there, and it's not clear how to do that.


Post a reply to this message

From: Jim Holsenback
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 7 Jul 2016 16:09:26
Message: <577eb6f6$1@news.povray.org>
On 7/7/2016 2:56 PM, Bald Eagle wrote:
> Le_Forgeron <jgr### [at] freefr> wrote:
>
>> Add a note in the talk page, at the end of it. If possible, provide also the text
you would like to see.
>
> I don't have a login for the wiki pages.
> I suppose I need to create an account and a login if you want me to post things
> over there, and it's not clear how to do that.
>
>
just post here ... turned off account creation a while ago due to 
excessive spamming


Post a reply to this message

From: Bald Eagle
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 7 Jul 2016 19:10:00
Message: <web.577ee122ff0686005e7df57c0@news.povray.org>
Suggested language for that section:

This is a vector function, since it returns a 5-component color vector of the
rgbft type which can then be used in other functions to generate isosurfaces.
The function must be declared before the vector data can be accessed.
Any individual component of the rgbft vector can then be used just like any
other variable.  When using the vector component identifiers, you have to
specify exactly which component of the color vector should be used, and that is
done with the "dot notation."

For the examples below, refer to the above pigment function: fn_Pigm(x,y,z)

When the pigment function is evaluated for any <x, y, z>, it returns a color
vector as a result
That color vector has five "terms" or "components" which define the pigment in
3D space for every x, y, and z.
Several components have equivalent and interchangeable "dot" notations which is
useful depending upon what the vector is describing - a point in space, a color,
or uv-mapped points.

To specify these individual vector components, use the following "dot" types:

fn_Pigm( ).x | fn_Pigm( ).u | fn_Pigm( ).red
to get the red value of the color vector
(or the first term of _any_ 3, 4, or 5-term vector)
All 3 dot notations for the vector component refer to the same value and so give
the same result.  All of the below notations work in an analogous manner.

fn_Pigm( ).y | fn_Pigm( ).v | fn_Pigm( ).green
to get the green value of the color vector
(or the second term of _any_ 3, 4, or 5-term vector)

fn_Pigm( ).z | fn_Pigm( ).blue
to get the blue value of the color vector
(or the third term of _any_ 3, 4, or 5-term vector)

fn_Pigm( ).filter | fn_Pigm( ).t
to get the filter value of the color vector
(or the fourth term of _any_ 4 or 5-term vector)
[*For clarity, note that this is .filter, spelled-out, or .t _not_ .f]

fn_Pigm( ).transmit
to get the transmit value of the color vector
(or the fifth term of _any_ 5-term vector)
[*For clarity, note that this is .transmit, spelled-out, _not_ .t]

There is also a special-purpose operator, which returns a weighted grayscale
value:

fn_Pigm( ).gray to get the gray value of the color vector
The internal formula for calculating this gray value is as follows:
gray value = Red*0.297 + Green*0.589 + Blue*0.114

[The alternate spelling, ".grey", and .g are not supported as of version 3.7]

[Also, POV-Ray calculates heightfield values from vector data. Although that
value cannot currently be accessed with dot notation like the grayscale values,
the formula for calculating a heightfield value is:  hf value = (Red +
Green/255)*0.996093]


Post a reply to this message

From: Jim Holsenback
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 9 Jul 2016 20:32:41
Message: <578197a9$1@news.povray.org>
On 7/7/2016 1:48 PM, Le_Forgeron wrote:
> I would suggest to leave "Numeric_Expressions" as it is so far, and adding, in both
"Vector_Expressions" and "Colour_Expressions", a dedicated section about getting
individual component out of a vector and colour.

http://wiki.povray.org/content/Documentation:Reference_Table_of_Contents#Scene_Description_Language


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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