POV-Ray : Newsgroups : povray.general : user-defined media density function : Re: user-defined media density function Server Time
31 Jul 2024 22:11:46 EDT (-0400)
  Re: user-defined media density function  
From: Mike Williams
Date: 24 Aug 2006 21:11:49
Message: <vDNYPGAmvk7EFwX$@econym.demon.co.uk>
Wasn't it Eric Buddington who wrote:
>I'm trying to model the Earth's atmosphere (as a sphere) using scattering
>media.
>The atmosphere's density follows a e^(height) type function.
>The available wave types don't seem to include this. I've played with
>spherical mapping and poly and cubic wave types,but it's unsatisfactory so
>far.
>
>Is there a way for me to create a radial density pattern of A^Br, where 'r'
>is the radius and A and B are constants?

You can use any function{} as a media density pattern

http://www.econym.demon.co.uk/isotut/patterns.htm#density

You could #include functions.inc and use f_r(x,y,z) as an expression for
r, or you could use pow((x*x+y*y+z*z),0.5).

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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