![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> Hi,
> 1) How can I know the pigment/color of a given object ?
> 2) What is the format of a pigment variable ? How can I extract each
> component ?
>
> Regards
thanks you all for all your answers.
I might have been more precise in my question.
Given an object, how can I know its color at a given point ?
I was thinking of a function getColor(obj,position), something like
min_extent(obj), for example.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
<use### [at] domain invalid> wrote in message news:49aaae1a$1@news.povray.org...
>> Hi,
>> 1) How can I know the pigment/color of a given object ?
>> 2) What is the format of a pigment variable ? How can I extract each
>> component ?
>>
>> Regards
> thanks you all for all your answers.
> I might have been more precise in my question.
> Given an object, how can I know its color at a given point ?
> I was thinking of a function getColor(obj,position), something like
> min_extent(obj), for example.
>
You can assign the pigment to an identifier. Use the identifier to assign
the pigment to the object and use the same pigment identifier with the
eval_pigment macro to establish the color at a position of your choosing.
You can certainly use the min_extent function to retrieve a location if
that's the position that you want to evaluate.
You should make sure you don't transform the object after assigning the
declared pigment to it.
Regards,
Chris B.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
use### [at] domain invalid wrote:
> I might have been more precise in my question.
> Given an object, how can I know its color at a given point ?
> I was thinking of a function getColor(obj,position), something like
> min_extent(obj), for example.
As far as I know you can't. You can, however, remember the pigment you assigned
to the object, and use that eval_pigment() macro Chris mentioned.
The *apparent* color of an object as seen from point P, however, is yet another
story: You simply cannot do that, as it depends on lighting conditions and - if
the object has a reflective or refractive material - other objects nearby. You'd
need to set up a complete scene, trace it, and use the resulting image in a
pattern function to retrieve individual pixels from it for your main shot.
Is there something specific you intend to do? Maybe there's a different way to
achieve the desired results.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>
>> Hi,
>> 1) How can I know the pigment/color of a given object ?
>> 2) What is the format of a pigment variable ? How can I extract each
>> component ?
>>
>> Regards
>
> thanks you all for all your answers.
> I might have been more precise in my question.
> Given an object, how can I know its color at a given point ?
> I was thinking of a function getColor(obj,position), something like
> min_extent(obj), for example.
>
>
the problem, is that, as the object is passed as an argument to a macro,
I have no a priori idea of its color...
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
use### [at] domain invalid wrote:
> the problem, is that, as the object is passed as an argument to a macro,
> I have no a priori idea of its color...
Then, unfortunately, you are lost. Unless you can convince the user to pass the
pigment as a separate parameter.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
use### [at] domain invalid nous illumina en ce 2009-03-01 10:47 -->
> use### [at] domain invalid a écrit :
>> Hi,
>> 1) How can I know the pigment/color of a given object ?
>> 2) What is the format of a pigment variable ? How can I extract each
>> component ?
>>
>> Regards
> thanks you all for all your answers.
> I might have been more precise in my question.
> Given an object, how can I know its color at a given point ?
> I was thinking of a function getColor(obj,position), something like
> min_extent(obj), for example.
>
>
You can use the trace function to find a point at the surface of an object. If
you have a texture identifier associated to that object, you can then use
eval_pigment to get the pigment at that location.
Be wary that if you translate, rotate or scale the object after you assign it
the texture, the texture will get transformed with the object, but the texture
evaluated by eval_pigment wont. So, it's best to evaluate the pigment before any
transformations. The other way, is to trace to an invert transformed point.
--
Alain
-------------------------------------------------
When you can't tell the difference between satire and what your opposition
actually believes, its about time to have a good laugh at it all
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Chris B" <nom### [at] nomail com> wrote:
>
> The other one of interest is .gray which I guess averages out the rgb values
> (I've never used it).
>
The .gray 'averaging' scheme seems to be full of black magic and voodoo. I've
lately been trying to figure out just *how* it produces its values (armed with
the only formula found in the docs, at "HF_Gray_16"...which offers no real hint
of the underlying computations.) But I'll leave that question for a later post
of its own. All in all, very mysterious!
KW
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"clipka" <nomail@nomail> schreef in bericht
news:web.49aaa0122533534f2ddf2a340@news.povray.org...
> "Chris B" <nom### [at] nomail com> wrote:
>> The eval_pigment function can used to 'read' that colour from any pigment
>> that you've assigned to an identifier.
>
> Hum... I live and learn...
>
It is great to place objects on a surface using a pre-defined image_map to
determine where you want to put what. For instance, you can write a macro
like this one:
#macro EvalPig3x(Map,Pos,Object1,Object2,Object3)
#local Shade = eval_pigment(Map,<Pos.x,0,Pos.z>);
#if (Shade.red = 1)
object {
Object1
translate Pos
}
#end
#if (Shade.green = 1)
object {
Object2
translate Pos
}
#end
#if (Shade.blue = )
object {
Object3
translate Pos
}
#end
#end
Thomas
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Kenneth" <kdw### [at] earthlink net> wrote:
> > The other one of interest is .gray which I guess averages out the rgb values
> > (I've never used it).
>
> The .gray 'averaging' scheme seems to be full of black magic and voodoo. I've
> lately been trying to figure out just *how* it produces its values (armed with
> the only formula found in the docs, at "HF_Gray_16"...which offers no real hint
> of the underlying computations.) But I'll leave that question for a later post
> of its own. All in all, very mysterious!
The isosurface tutorial page mentions it:
gray value = Red*29.7% + Green*58.9% + Blue*11.4%
and gives a more thorough run-down on colour dot operators. Look here:
http://www.povray.org/documentation/view/3.6.1/73/
and scroll down to 1.3.3.3.7 - "Pigment and noise functions".
Bill
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Bill Pragnell" <bil### [at] hotmail com> wrote:
> The isosurface tutorial page mentions it:
>
> gray value = Red*29.7% + Green*58.9% + Blue*11.4%
>
> and gives a more thorough run-down on colour dot operators. Look here:
>
> http://www.povray.org/documentation/view/3.6.1/73/
>
> and scroll down to 1.3.3.3.7 - "Pigment and noise functions".
>
Thanks, didn't remember seeing it there. The .hf operator is intriguing.
Hmm....
KW
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |