POV-Ray : Newsgroups : povray.advanced-users : Finding Pigment / color of an object : Re: Finding Pigment / color of an object Server Time
3 Jul 2024 06:05:24 EDT (-0400)
  Re: Finding Pigment / color of an object  
From: Chris B
Date: 1 Mar 2009 11:11:12
Message: <49aab3a0$1@news.povray.org>
<use### [at] domaininvalid> 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

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