POV-Ray : Newsgroups : povray.advanced-users : Media Density Question : Re: Media Density Question Server Time
5 Jul 2024 14:20:51 EDT (-0400)
  Re: Media Density Question  
From: Alain
Date: 17 Jan 2008 11:31:32
Message: <478f82e4$1@news.povray.org>
Woody nous apporta ses lumieres en ce 2008/01/17 06:44:
> 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
> }
> 
> 
> 
In addition to what others have proposed, you can experiment with the various 
wave forms available. They are:
ramp_wave //the default for the gradient pattern
triangle_wave // used in the marble and wood patterns
sine_wave
scallop_wave // use the absolute value of a sine
cubic_wave
poly_wave [float]

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when your wife's raytraced image you 
made to flatter her is the only one you see of her anymore.
Ken Tyler


Post a reply to this message

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