POV-Ray : Newsgroups : povray.general : Turning of green and blue in a declared pigment pattern : Re: Turning of green and blue in a declared pigment pattern Server Time
30 Jul 2024 08:21:21 EDT (-0400)
  Re: Turning of green and blue in a declared pigment pattern  
From: Mike Williams
Date: 2 May 2009 15:14:44
Message: <$gI5OKAZuJ$JFwzD@econym.demon.co.uk>
Wasn't it gregjohn who wrote:
>I've got a declared pigment pattern.  I want to have another pigment that is
>only the red component of that pattern, AND is *red*. I tried some things  with
>multiplying functions, but povray kept turning it into a pigment that 
>is *white*
>when the original is red.

This creates a pigment where the B and G components are always zero, and 
the R component is from the original pigment:

#declare f=function{pigment {p}}
#declare p2 = pigment{function{f(x,y,z).red}
      colour_map {[0 rgb 0][1 rgb <1,0,0>]}}

red => red
blue => black
green => black
white => red

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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