POV-Ray : Newsgroups : povray.newusers : Is it possible to have color_map values depend on distance from a point ? : Re: Is it possible to have color_map values depend on distance from a point ? Server Time
2 Nov 2024 17:20:39 EDT (-0400)
  Re: Is it possible to have color_map values depend on distance from a point ?  
From: Christopher James Huff
Date: 18 Nov 2003 21:47:24
Message: <cjameshuff-C7AE9D.21441218112003@netplex.aussie.org>
In article <web.3fba9d39f0c1c7f425bdb9a40@news.povray.org>,
 "Bernard Hatt" <bmh### [at] arkadydemoncouk> wrote:

> I'm trying to put a coloured bozo 'splodge' on an object, where the
> color_map threshold varies from the center to the edge.

There are several options. You could create a pigment map with the 
spherical pattern...basically what you did with layered textures, but 
far more efficient. However, with the example you gave, it would be 
simpler to just use a function pattern. Something like this:

box { <-2,-2,0> <2,2,1 >
    texture {
        pigment {
            function {
                select(f_noise3d(x/0.025, y/0.025, z/0.025) > f_r(x, y, 
z), 1, 0)
            }
            color_map {
                [0.5 color Green]
                [0.5 color Red]
            }
        }
    }
}

If the noise function (which is just what the bozo pattern is) is less 
than the distance, the pattern has a value of 1, otherwise it is 0. You 
may also get good results with something like:

function {f_noise3d(x/0.025, y/0.025, z/0.025)*max(0, 1 - f_r(x, y, z))}

This is essentially the same as multiplying bozo and the spherical 
pattern. The value of the noise gets scaled down to 0 as the distance 
from the origin approaches 1.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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