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:21:11 EDT (-0400)
  Re: Is it possible to have color_map values depend on distance from a point=  
From: Christopher James Huff
Date: 21 Nov 2003 15:15:06
Message: <cjameshuff-D3E750.15094821112003@netplex.aussie.org>
In article <web.3fbd0dccbe538fb825bdb9a40@news.povray.org>,
 "Bernard Hatt" <bmh### [at] arkadydemoncouk> wrote:

> I see what you mean, I had just been trying to increase the 'density'
> of the pattern in the middle.

Hmm...a better way of doing that would be to just adjust the minimum of 
the range of the noise function until its minimum and maximum are 1. 
Um...

f_noise3d(...)*min(1, f_r(...)) + 1 - min(1, f_r(...))

At r = 0, noise will be multiplied by 0 and the function result will be 
1. At r >= 1, the function will be pure noise. Or flip it around, making 
a porous hole in an otherwise solid function:

f_noise3d(...)*max(0, 1 - f_r(...)) + min(1, f_r(...))

Or simpler, use the adj_range() function in math.inc:
adj_range(f_noise3d(...), min(1, f_r(...)), 1)

This might actually be faster, because of one less evaluation of 
f_r()...it depends on how much overhead the function call takes.
Here's an interesting version I came up with:
function {adj_range(f_crackle(x*5, y*5, z*5), cos(pi*max(0, 1 - f_r(x/5, 
y/5, z/5)))/2 + 0.5, 1)}


> If only I could remember all the maths that I learnt years ago :-) , I
> did manage to play around and produce a spirally thing:

Well, I find the most important thing is to just remember what the 
various functions look like when graphed, and figure out what they "look 
like" when combined.

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