POV-Ray : Newsgroups : povray.newusers : Pigment colour from RGB functions : Re: Pigment colour from RGB functions Server Time
2 Jun 2024 14:47:04 EDT (-0400)
  Re: Pigment colour from RGB functions  
From: scott
Date: 22 May 2013 11:47:57
Message: <519ce8ad$1@news.povray.org>
>> Suppose I have a mathematical formula to calculate the R, G and B values
>> of a pigment based on the coordinates (x,y,z), how to write that in POV?
...
 >
> #macro fnColor(thisPoint)
>    rgb <fnR(thisPoint.x),fnR(thisPoint.z),fnR(thisPoint.z)>
> #end
>
> pigment{color fnColor(<a,b,c>) }

That won't work for me, as the RGB values depend on the coordinates of 
the object the pigment is applied to (so it's not a constant colour). 
I'm using the method waggy suggested, but modified to cope with large 
values. I just wondered if there was a neater way to specify this, 
that's all.


Post a reply to this message

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