POV-Ray : Newsgroups : povray.advanced-users : How to address last 2 components of 5-component vectors? Server Time
1 Jun 2024 19:21:18 EDT (-0400)
  How to address last 2 components of 5-component vectors? (Message 7 to 16 of 46)  
<<< Previous 6 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Jim Holsenback
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 7 Jul 2016 13:16:18
Message: <577e8e62$1@news.povray.org>
On 7/7/2016 10:37 AM, Le_Forgeron wrote:
> Le 07/07/2016 15:30, Bald Eagle a écrit :
>> At first I mis-read the docs and thought I could have 6-component vectors, and
>> address them x, y, z, t, u, v.
>>
>> I trimmed that to 5, and thought that maybe x, y, z, u, v was the way to go, but
>> I should have known better.
>>
>> I need to use those last 2 values - what are they called?
>>
>
> Bad, bad wiki (In the mood of "Bad, bad zoot", of "Monty Python and the Holy Grail")
> You can access the component of 5D vector as a colour: red, green, blue, filter,
transmit
>
> Yes, in that order. Which mean that .t == .filter, not .transmit
>

OK ... so please be a bit more specific. What /exactly/ is "bad" and 
needs clarification. Comment on the talk page and I'll work it into the 
docs.


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 13:40:00
Message: <web.577e93d3ff0686005e7df57c0@news.povray.org>
Jim Holsenback <spa### [at] nothanksnet> wrote:

> OK ... so please be a bit more specific. What /exactly/ is "bad" and
> needs clarification. Comment on the talk page and I'll work it into the
> docs.

Jerome posted at
http://wiki.povray.org/content/Reference_Talk:Vector_Expressions

"The page Vector sends to Numeric Expression, but that one dismiss any details
about DOT_ITEM by sending back to Vector / Colour Pages, none of which cover the
subject."

I think that addressing the following ought to explicitly, clearly and
unambiguously describe what the values are as well as show examples of their
usage.

(I'm assuming that Vector.gray = (Vector.red + Vector.green + Vector.blue)/3
and that would be a helpful tidbit in the docs as well. )

#version 3.7;
global_settings {assumed_gamma 1.0}
#include "debug.inc"
  Set_Debug (true)

#declare Vector = <1, 2, 3, 4, 5>;

#debug concat( "Vector.x =        ", str(Vector.x, 3, 0), "\n")
#debug concat( "Vector.red =      ", str(Vector.red, 3, 0), "\n")
#debug concat( "Vector.u =        ", str(Vector.u, 3, 0), "\n\n")

#debug concat( "Vector.y =        ", str(Vector.y, 3, 0), "\n")
#debug concat( "Vector.green =    ", str(Vector.green, 3, 0), "\n")
#debug concat( "Vector.v =        ", str(Vector.v, 3, 0), "\n\n")

#debug concat( "Vector.blue =     ", str(Vector.blue, 3, 0), "\n")
#debug concat( "Vector.z =        ", str(Vector.z, 3, 0), "\n\n")

#debug concat( "Vector.t =        ", str(Vector.t, 3, 0), "\n")
#debug concat( "Vector.filter =   ", str(Vector.filter, 3, 0), "\n\n")

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

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


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 13:48:17
Message: <577e95e1$1@news.povray.org>
Le 07/07/2016 19:16, Jim Holsenback a écrit :
> On 7/7/2016 10:37 AM, Le_Forgeron wrote:
>> Le 07/07/2016 15:30, Bald Eagle a écrit :
>>> At first I mis-read the docs and thought I could have 6-component vectors, and
>>> address them x, y, z, t, u, v.
>>>
>>> I trimmed that to 5, and thought that maybe x, y, z, u, v was the way to go, but
>>> I should have known better.
>>>
>>> I need to use those last 2 values - what are they called?
>>>
>>
>> Bad, bad wiki (In the mood of "Bad, bad zoot", of "Monty Python and the Holy
Grail")
>> You can access the component of 5D vector as a colour: red, green, blue, filter,
transmit
>>
>> Yes, in that order. Which mean that .t == .filter, not .transmit
>>
> 
> OK ... so please be a bit more specific. What /exactly/ is "bad" and needs
clarification. Comment on the talk page and I'll work it into the docs.

As stated in the talk page of Vector Expressions:
The page Vector sends to Numeric Expression, but that one dismiss any details about
DOT_ITEM by sending back to Vector / Colour Pages, none of which cover the subject.

In Numerics Expressions page, we have "The DOT_ITEM syntax is actually a vector or
color operator but it returns a float value. See Vector Operators or Color Operators
for details".

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

Here the loop is smaller, but no one would give a newbie the information about getting
a component from a vector (or colour).

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.

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: Le Forgeron
Subject: Re: How to address last 2 components of 5-component vectors?
Date: 7 Jul 2016 13:52:28
Message: <577e96dc$1@news.povray.org>
Le 07/07/2016 19:39, Bald Eagle a écrit :
> (I'm assuming that Vector.gray = (Vector.red + Vector.green + Vector.blue)/3
> and that would be a helpful tidbit in the docs as well. )

Sorry to disappoint you, but gray formula is more complex (the weight of each of the 3
components are different)

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

but it might be useful to repeat it in the "Colour_Expressions" page.

gray value = Red*29.7% + Green*58.9% + Blue*11.4%


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: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

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

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