POV-Ray : Newsgroups : povray.advanced-users : Media Density Question : Media Density Question Server Time
5 Jul 2024 14:21:12 EDT (-0400)
  Media Density Question  
From: Woody
Date: 17 Jan 2008 06:50:01
Message: <web.478f3fba1e3bd89b94e61a50@news.povray.org>
Is there anyway to change how a gradient density fades off?

The following scene has a density that's a linear gradient. That is it falls off
in a linear fashion. Is there any way to change this so the density falls off
say at a geometric or exponential rate? Maybe instead of a linear decreasing
density, something where the density is sinosoidal?

Maybe a density map of some type?

Any help appreciated.


#declare cam_pos=(x*4+y*3+z*-2)*2;
camera {
  location cam_pos
  look_at (x*1+y*0+z*0)*0.5
}

light_source {
  cam_pos
  color White // add *2 if this light is not bright enough
}

cylinder { 0, <1,0,0>, 1
         pigment {rgbt 1}
         hollow
         finish{ ambient 0.000 diffuse 0.000 specular 0}
         interior{
                 media{
                         emission y/2

                         density {gradient -x scale 1.01}
                }
         }
         scale x*3
}


Post a reply to this message

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