POV-Ray : Newsgroups : povray.newusers : absorbing media question Server Time
1 Nov 2024 01:24:05 EDT (-0400)
  absorbing media question (Message 1 to 3 of 3)  
From: mine
Subject: absorbing media question
Date: 24 Jul 2006 23:40:01
Message: <web.44c59203d1424b84a6ac26a70@news.povray.org>
Hi, here is what I want to do: I have a cube (it could be a rectangle later
on) and I have made it hollow and filled it with absorbing media and made
the cube clear. the light source is above it. I want to progressively
change the amount I am absorbing as I go away from the light. I want to
absorb more light the further away I get from the light source. I figure I
have to use a density_map but I'm not sure how to that for a cube (or
similar) shape. I have done a density_map for a sphere with emitting media
before. Thanks for any help. :)


Post a reply to this message

From: M a r c
Subject: Re: absorbing media question
Date: 25 Jul 2006 06:01:43
Message: <44c5ec07$1@news.povray.org>

web.44c59203d1424b84a6ac26a70@news.povray.org...
> Hi, here is what I want to do: I have a cube (it could be a rectangle
later
> on) and I have made it hollow and filled it with absorbing media and made
> the cube clear. the light source is above it. I want to progressively
> change the amount I am absorbing as I go away from the light. I want to
> absorb more light the further away I get from the light source. I figure I
> have to use a density_map but I'm not sure how to that for a cube (or
> similar) shape. I have done a density_map for a sphere with emitting media
> before. Thanks for any help. :)
>
>
>
This could work

#declare Material1 =
   material
   {
      texture
      {
         pigment
         {
            color rgbt  1
         }
      }
      interior
      {
         media
         {
            absorption rgb <1.0, 1.0, 1.0>
            density
            {
               boxed
               color_map
               {
                  [ 0.0     rgb 0 ]
                  [ 1.0     rgb 1 ]
               }
            }
         }
      }
   }


Post a reply to this message

From: Alain
Subject: Re: absorbing media question
Date: 25 Jul 2006 22:17:20
Message: <44c6d0b0$1@news.povray.org>
mine nous apporta ses lumieres en ce 24/07/2006 23:38:
> Hi, here is what I want to do: I have a cube (it could be a rectangle later
> on) and I have made it hollow and filled it with absorbing media and made
> the cube clear. the light source is above it. I want to progressively
> change the amount I am absorbing as I go away from the light. I want to
> absorb more light the further away I get from the light source. I figure I
> have to use a density_map but I'm not sure how to that for a cube (or
> similar) shape. I have done a density_map for a sphere with emitting media
> before. Thanks for any help. :)
> 
> 
> 
You can use a simple gradient pattern. As your light is above the box, a 
gradient y dencity_map{[0 rgb 1][1 rgb 0]} would be apropriate. Scale it 
verticaly to slightly over match the hight of the box. If the box is 2 units 
high, scale the gradient by 2.001 in the y direction to prevent the pattern from 
starting to repeat at the top of the box. Translate it verticaly so that it 
matches the base of the box.

-- 
Alain
-------------------------------------------------
BACHELOR: A man who never makes the same mistake once.


Post a reply to this message

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