![](/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) |
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) |