POV-Ray : Newsgroups : povray.general : Reading a colour on an object : Re: Reading a colour on an object Server Time
8 Jul 2024 13:23:39 EDT (-0400)
  Re: Reading a colour on an object  
From: Anthony D  Baye
Date: 11 Nov 2014 12:05:01
Message: <web.5462417fa4f9ea0062d177fa0@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> I am suddenly not sure. Is it possible to read a colour at a defined
> point - using trace() - on the surface of an object, by using
> eval_pigment() at that point? I know how to do it with an image_map as
> intermediary but can it be done directly?
>
> For instance, if object{A} has a texture{B} and trace() finds a position
> P=<x,y,z> on the surface of A, would the colour at P then be
> D=eval_pigment(A,P) ? That obviously does not work as A is not a
> pigment. However, I would like to do something like that but do not know
> how.
>
> Thomas

Since Trace only returns the point of intersection and the normal vector, and
there's really no way to query object attributes, the best I'd think you could
do is pass the intersection Point and the pigment to eval_pigment...

Although... You might get more information from a function.   It's worth
investigating.

Regards,
A.D.B.


Post a reply to this message

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