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:25:36 EDT (-0400)
  Re: Finding Pigment / color of an object  
From: Thomas de Groot
Date: 2 Mar 2009 03:03:19
Message: <49ab92c7$1@news.povray.org>
"clipka" <nomail@nomail> schreef in bericht 
news:web.49aaa0122533534f2ddf2a340@news.povray.org...
> "Chris B" <nom### [at] nomailcom> 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

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