POV-Ray : Newsgroups : povray.advanced-users : Color function : Re: Color function Server Time
28 Jul 2024 14:30:03 EDT (-0400)
  Re: Color function  
From: PM 2Ring
Date: 30 Apr 2005 04:45:01
Message: <web.427344b2d92a7201e1f4d92c0@news.povray.org>
Hi val,

> "PM 2Ring" <nomail@nomail> wrote:
> > Here's one possibility below. You may also like to know that POV can cope
> > with negative colour values. I'll post a relevant example soon.
>
> Thanks. It works! It took me a couple of days to realize that
> the function should span in RGB components:
>
> #declare fun_x = function { color_x*max(0, (sx*(x-px) + sy*(y-py) +
> sz*(z-pz))/raio) + color_x*amb  }
> #declare fun_y = function { color_y*max(0, (sx*(x-px) + sy*(y-py) +
> sz*(z-pz))/raio) + color_y*amb  }
> #declare fun_z = function { color_z*max(0, (sx*(x-px) + sy*(y-py) +
> sz*(z-pz))/raio) + color_z*amb  }
>
> #declare PigRGB =
> pigment{
>   average
>   pigment_map {
>     [1 function{fun_x(x,y,z)} color_map{[0 rgb 0][1 red 3]}]
>     [1 function{fun_y(x,y,z)} color_map{[0 rgb 0][1 green 3]}]
>     [1 function{fun_z(x,y,z)} color_map{[0 rgb 0][1 blue 3]}]
>   }
> }
> Val

Great! I forgot about cleaning up my negative colours example, but in the
mean time I'll post a related pigment function example in p.b.i., thread
"Pigment Functions". This one lets you do a fake MC Escher "Circle Limit"
effect, using stereographic projection.


Post a reply to this message

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