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
30 Jul 2024 18:23:30 EDT (-0400)
  Re: Is it possible to have color_map values depend on distance from a point= ?  
From: Christopher James Huff
Date: 19 Nov 2003 22:16:06
Message: <cjameshuff-55CA0B.22111019112003@netplex.aussie.org>
In article <web.3fbba93a2591b98225bdb9a40@news.povray.org>,
 "Bernard Hatt" <bmh### [at] arkadydemoncouk> wrote:

> Your example with the select() seems to need a value that can be +ve or -ve
> to work:
> eg.
> function {select( f_noise3d(x/0.025, y/0.025, z/0.025) - f_r(x, y,z), 0, 1)}

Er, oops...


> but the multiplying bozo and the spherical pattern also produced a nice
> result:
> function {f_noise3d(x/0.025, y/0.025, z/0.025)*max(0, 1.5 - f_r(x, y, z))}

Note that the f_noise3d() function returns a maximum of 1.0, and by 
changing the "max(0, 1 - f_r(x, y, z)" to "max(0, 1.5 - f_r(x, y, z))", 
you increase the maximum of that factor to 1.5...so the function ranges 
from 0 to 1.5, which will be wrapped when used as a pattern. If you want 
to change the radius, you should scale the result of the f_r() function 
instead:

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

You may want to play around with different falloff rates as well...think 
about what various n^2 or sqrt(n) do in the range 0..1, or what sin() 
does in the ranges 0..pi/2 and -pi/2..pi/2. Or combine several of 
these...a cos() function for a ripple effect and a quadratic falloff. 
Use atan2() to vary things with angle...

-- 
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.