  | 
  | 
 
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
How do you control the density of a medium at a given point?
For instance, if you use a spherical pattern then the medium is fully opaque at
the center of the sphere, and is fully transparent at the outer radius.
BUT, what if I want the sphere to be 25% transparent at 1/3 of the distance from
the center?
How do I control that?
Thanks!
Mike
 
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
"posfan12" <nomail@nomail> wrote:
> How do you control the density of a medium at a given point?
>
> For instance, if you use a spherical pattern then the medium is fully opaque at
> the center of the sphere, and is fully transparent at the outer radius.
>
> BUT, what if I want the sphere to be 25% transparent at 1/3 of the distance from
> the center?
>
> How do I control that?
>
> Thanks!
>
>
> Mike
Hi Mike,
you can use color_maps or density_maps within the media. Something like this:
 media{
    emission 0.75
    scattering {1, 0.5}
    density { spherical
      density_map {
        [0.0 rgb 0]
        [2/3 rgb 1]
        [1.0 rgb 1]
      }
    }
  }
Best regards,
Michael
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
"MichaelJF" <mi-### [at] t-online de> wrote:
> Hi Mike,
>
> you can use color_maps or density_maps within the media. Something like this:
>
>  media{
>     emission 0.75
>     scattering {1, 0.5}
>     density { spherical
>       density_map {
>         [0.0 rgb 0]
>         [2/3 rgb 1]
>         [1.0 rgb 1]
>       }
>     }
>   }
>
> Best regards,
> Michael
Are you sure? I thought color maps are just for changing the color of the media
at different densities, and density maps are for using multiple pre-defined
densities.
Mike
 
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
Wouldn't it be better to define a new function instead of messing with the
color/density maps?
Something like this maybe (I'm still working on the ringworld project):
density
{
 function {1-f_cylindrical(x,y,z)}
}
But how would I rewrite the function for my scene if:
1. the radius of the habitat ring is equal to "ring_radius" and the height of
the atmosphere is equal to "atmosphere_height"
2. the atmosphere should have 0 density at the top and some arbitrary low value
like 10% at the ring surface.
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
On 13-10-2013 12:29, posfan12 wrote:
> "MichaelJF" <mi-### [at] t-online de> wrote:
>> Hi Mike,
>>
>> you can use color_maps or density_maps within the media. Something like this:
>>
>>   media{
>>      emission 0.75
>>      scattering {1, 0.5}
>>      density { spherical
>>        density_map {
>>          [0.0 rgb 0]
>>          [2/3 rgb 1]
>>          [1.0 rgb 1]
>>        }
>>      }
>>    }
>>
>> Best regards,
>> Michael
>
> Are you sure? I thought color maps are just for changing the color of the media
> at different densities, and density maps are for using multiple pre-defined
> densities.
You can use a density map to control how dense the media will be, like 
Michael shows. A density map interprets the grey values. rgb 0 is 
transparent; rgb 1 is opaque. If you use colours, they are interpreted 
as grey values.
Thomas
 
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
Better to  have a complete example:
global_settings { assumed_gamma 1 }
 background { rgb 1 }
 camera { location <3,4,-5>*.8 look_at 0 angle 35 }
 light_source { <20,40,10>, 1 }
 box // floor
 { <-1.5,-1.01,-1.5>, <1.5,-1.2,1.5>
   pigment { checker rgb 0.75, rgb 0.25 scale 0.2 }
 }
 box
 { -1,1 pigment { rgbt 1 } hollow
   interior
   { media
     { scattering { 1, 0.5 }
       density {
          gradient y
          color_map {
             [ 0 rgb 1 ]
             [ 1/3 rgb 1 ]
             [ 2/3 rgb 0 ]
             [1 rgb 0 ]
          }
          scale 2
          translate -y
       }
     }
   }
 }
 cylinder
 { <0.9, -1, 0.7>, <0.9, 0.9, 0.7>, 0.5
   pigment { rgb <1, 0.8, 0.5> }
 }
This is a modification of the demo-scene from the POV-documentation. I added
only the density (scaled and translated to meet the scene). As you can see,
there is no density at the top third, increasing to 1 at the bottom third.
Best regards,
Michael
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 
 | 
  |