POV-Ray : Newsgroups : povray.advanced-users : Hot to combine several df3 in media? Server Time
25 Dec 2024 21:30:13 EST (-0500)
  Hot to combine several df3 in media? (Message 1 to 2 of 2)  
From: arm2arm
Subject: Hot to combine several df3 in media?
Date: 29 Aug 2006 05:20:00
Message: <web.44f406997702aad6b399450c0@news.povray.org>
Hello,
I have a 2 volume data(Gas_Density.df3 and Gas_Temperature.df3) on a grid
512^3 in df3 format.
The data from cosmological simulation.
How can I combine this 2 medias in such a way, where
emission/absorption/intensity will calculated from Gas_Density.df3 and for
color coding will use Gas_Temperature.df3?
I used simple way only to show one media and its looks like:
http://www.aip.de/~arm2arm/COSMOLOGY/MareNostrum/marenostrum_Gas_divx5.avi
Following script whas used to render it:
#declare box_map=color_map{
[0.0 rgbt <0,0,0,0>]
[0.090000 rgbt <0,0,0,0>]
[0.090000 rgb <0.000000,0.000000,0.000000>*0.000000]
[0.181000 rgb <0.320312,0.000000,0.406250>*1.011081]
[0.272000 rgb <0.214844,0.000000,0.871094>*2.099685]
[0.363000 rgb <0.000000,0.347656,0.996094>*3.388788]
[0.454000 rgb <0.000000,0.894531,0.996094>*5.107829]
[0.545000 rgb <0.000000,0.996094,0.496094>*7.744151]
[0.636000 rgb <0.046875,0.996094,0.000000>*12.469423]
[0.727000 rgb <0.628906,0.996094,0.000000>*22.534557]
[0.818000 rgb <0.996094,0.746094,0.000000>*48.754704]
[0.909000 rgb <0.996094,0.148438,0.000000>*136.620132]
[1.000000 rgbt <0,0,0,0>*100]
[1 rgb 1000]
}

#declare Container_T= texture {
   pigment {rgbt <1,1,1,1>}
   finish {ambient 0 diffuse 0}
}
#declare boxinterior = interior {
media {
  intervals 256
  ratio 0.5
  samples 1,1
  method 1
  emission <1,1,1>*1.8
  absorption <1,1,1>//*5.5
  scattering { 1, <0,0,0> }
  confidence 0.999
  variance 1/1000

  density {
    density_file df3 MediaFile interpolate 2
    color_map {box_map}
          }
}
}
box {
   <0,0,0>, 1
   pigment{rgbt 1}
   hollow
   texture {Container_T}
   interior { boxinterior}
   translate <-0.5,-0.5,-0.5>
   scale 2.0
}

////////////////////////

Thank you beforehand.
Arman.
+++++++++++++++++++++++++++++++++
Arman Khalatyan
Address:
Astrophysical Institute Potsdam,
An der Sternwarte 16,
D-14482 Potsdam, GERMANY
Phones: (+049) 0331 7499517(work)


Post a reply to this message

From: Alain
Subject: Re: Hot to combine several df3 in media?
Date: 29 Aug 2006 19:23:45
Message: <44f4cc81$1@news.povray.org>
arm2arm nous apporta ses lumieres en ce 29/08/2006 05:19:
> Hello,
> I have a 2 volume data(Gas_Density.df3 and Gas_Temperature.df3) on a grid
> 512^3 in df3 format.
> The data from cosmological simulation.
> How can I combine this 2 medias in such a way, where
> emission/absorption/intensity will calculated from Gas_Density.df3 and for
> color coding will use Gas_Temperature.df3?
> I used simple way only to show one media and its looks like:
> http://www.aip.de/~arm2arm/COSMOLOGY/MareNostrum/marenostrum_Gas_divx5.avi
> Following script whas used to render it:
> #declare box_map=color_map{
> [0.0 rgbt <0,0,0,0>]
> [0.090000 rgbt <0,0,0,0>]
> [0.090000 rgb <0.000000,0.000000,0.000000>*0.000000]
> [0.181000 rgb <0.320312,0.000000,0.406250>*1.011081]
> [0.272000 rgb <0.214844,0.000000,0.871094>*2.099685]
> [0.363000 rgb <0.000000,0.347656,0.996094>*3.388788]
> [0.454000 rgb <0.000000,0.894531,0.996094>*5.107829]
> [0.545000 rgb <0.000000,0.996094,0.496094>*7.744151]
> [0.636000 rgb <0.046875,0.996094,0.000000>*12.469423]
> [0.727000 rgb <0.628906,0.996094,0.000000>*22.534557]
> [0.818000 rgb <0.996094,0.746094,0.000000>*48.754704]
> [0.909000 rgb <0.996094,0.148438,0.000000>*136.620132]
> [1.000000 rgbt <0,0,0,0>*100]
> [1 rgb 1000]
> }
> 
> #declare Container_T= texture {
>    pigment {rgbt <1,1,1,1>}
>    finish {ambient 0 diffuse 0}
> }
> #declare boxinterior = interior {
> media {
>   intervals 256
>   ratio 0.5
>   samples 1,1
>   method 1
>   emission <1,1,1>*1.8
>   absorption <1,1,1>//*5.5
>   scattering { 1, <0,0,0> }
>   confidence 0.999
>   variance 1/1000
> 
>   density {
>     density_file df3 MediaFile interpolate 2
>     color_map {box_map}
>           }
> }
> }
> box {
>    <0,0,0>, 1
>    pigment{rgbt 1}
>    hollow
>    texture {Container_T}
>    interior { boxinterior}
>    translate <-0.5,-0.5,-0.5>
>    scale 2.0
> }
> 
> ////////////////////////
> 
> Thank you beforehand.
> Arman.
> +++++++++++++++++++++++++++++++++
> Arman Khalatyan
> Address:
> Astrophysical Institute Potsdam,
> An der Sternwarte 16,
> D-14482 Potsdam, GERMANY
> Phones: (+049) 0331 7499517(work)
> 
> 
> 
You want 1 df3 to control the density and the other one to control the colour.
If you have 2 density for the same media, they are multiplied. Anywhere one of 
the density evaluate to 0, the resulting density will be zero. So, you can use a 
monochrome color_map for the first df3, representing gas density, and use a 
colour coded one for the second, representing the gas temperature.
This is assuming that the second df3 have broad, diffuse areas contrasting with 
the string like pattern I saw in your video.

-- 
Alain
-------------------------------------------------
Zoroastrianism: Shit happens half on the time.


Post a reply to this message

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