POV-Ray : Newsgroups : povray.general : Can I use a function to create a pigment WITHOUT using a colour_map? : Re: Can I use a function to create a pigment WITHOUT using a colour_map? Server Time
30 Jul 2024 00:21:29 EDT (-0400)
  Re: Can I use a function to create a pigment WITHOUT using a colour_map?  
From: Rarius
Date: 12 Apr 2010 04:05:30
Message: <4bc2d44a$1@news.povray.org>
"Reactor" <rea### [at] hotmailcom> wrote in message 
news:web.4bc22e72256a6c956811279d0@news.povray.org...
> I am assuming those are pigment functions, which do not return a single 
> value -
> they return a color 3vector.  Assuming that they are returning a grayscale
> value, you can change that to:
>
> pigment
> {
> color rgbt <fRingRed(x,y,z).red,
>            fRingGreen(x,y,z).red,
>            fRingBlue(x,y,z).red,
>            fRingTrans(x,y,z).red>
> }
>
> Note that while I am extracting what would be the red component, this 
> doesn't
> have anything to do with the color produced by the pigment.  I am just 
> pulling
> the first float out of the 3 vector.

Your assumption is incorrect. The fRingXXX() functions return floats not 
vectors.

After searching the archives I came up with the following...

    #declare pRingColour=
    pigment
    {
        average
        pigment_map
        {
            [1 function { fRingColourRed(x,y,z) } color_map{[0 rgb 0][1 red 
3]}]
            [1 function { fRingColourGreen(x,y,z) } color_map{ [0 rgb 0][1 
green 3]}]
            [1 function { fRingColourBlue(x,y,z) } color_map{ [0 rgb 0][1 
blue  3]}]
        }
    }

Many thanks to all who helped.

Rarius


Post a reply to this message

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