POV-Ray : Newsgroups : povray.advanced-users : Finding Pigment / color of an object : Re: Finding Pigment / color of an object Server Time
5 Jul 2024 14:03:24 EDT (-0400)
  Re: Finding Pigment / color of an object  
From: Alain
Date: 1 Mar 2009 17:15:57
Message: <49ab091d$1@news.povray.org>
use### [at] domaininvalid nous illumina en ce 2009-03-01 10:47 -->
> use### [at] domaininvalid 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

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