POV-Ray : Newsgroups : povray.newusers : 3d color function Server Time
1 Nov 2024 23:13:43 EDT (-0400)
  3d color function (Message 1 to 4 of 4)  
From: Bernd Fuhrmann
Subject: 3d color function
Date: 21 Nov 2004 15:50:36
Message: <41a0ff9c@news.povray.org>
Hi!

I'd like to do something like this:

I've got three functions f_r, f_g and f_b, which all map [0,1]^3 to 
[0,1]. Now I'd like to have a rather complex object (don't worry, I know 
how to make that geometry) that are all bounded by a box {<0,0,0> 
<1,1,1>} where each point of that object has the color rgb <f_r(x,y,z), 
f_g(x,y,z), f_b(x,y,z)>.

I'd like to declare a material for that complex object, but how do I do 
that?

I already tried this:

#declare MyMaterial =
material{texture{pigment{
function {f_r(x, y, z)}
}}}

But this will only give my grayscales. How can I make colored?

f_r, f_g and f_b are nonlinear so gradients would work (I guess).

Thanks in advance,
Bernd Fuhrmann


Post a reply to this message

From: Slime
Subject: Re: 3d color function
Date: 21 Nov 2004 17:41:05
Message: <41a11981$1@news.povray.org>
> But this will only give my grayscales. How can I make colored?

You can do this:

pigment {
average
pigment_map {
[1 function {f_r(x,y,z)} color_map {[0 rgb 0][1 rgb <1,0,0>*3]}]
[1 function {f_g(x,y,z)} color_map {[0 rgb 0][1 rgb <0,1,0>*3]}]
[1 function {f_b(x,y,z)} color_map {[0 rgb 0][1 rgb <0,0,1>*3]}]
}
}

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Mike Williams
Subject: Re: 3d color function
Date: 22 Nov 2004 00:44:45
Message: <eJffeCAdyXoBFwNs@econym.demon.co.uk>
Wasn't it Bernd Fuhrmann who wrote:
>Hi!
>
>I'd like to do something like this:

You could use texture layering:

#declare texture3 =
texture {pigment {function {f_r(x,y,z)} color_map {[0 rgb 0][1 rgb x]}}}
texture {pigment {function {f_g(x,y,z)} color_map {[0 rgbt 1][1 rgb y]}}}
texture {pigment {function {f_b(x,y,z)} color_map {[0 rgbt 1][1 rgb z]}}}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Bernd Fuhrmann
Subject: Re: 3d color function
Date: 22 Nov 2004 02:25:55
Message: <41a19483$1@news.povray.org>
Slime wrote:
> You can do this:
> 
> pigment {
> average
> pigment_map {
> [1 function {f_r(x,y,z)} color_map {[0 rgb 0][1 rgb <1,0,0>*3]}]
> [1 function {f_g(x,y,z)} color_map {[0 rgb 0][1 rgb <0,1,0>*3]}]
> [1 function {f_b(x,y,z)} color_map {[0 rgb 0][1 rgb <0,0,1>*3]}]
> }
> }

Works. Thanks a lot.
Bernd Fuhrmann


Post a reply to this message

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