POV-Ray : Newsgroups : povray.general : Dust motes : Re: Dust motes Server Time
30 Jul 2024 08:28:36 EDT (-0400)
  Re: Dust motes  
From: Tim Attwood
Date: 3 Jul 2009 18:58:05
Message: <4a4e8cfd$1@news.povray.org>
>I was wondering how to achieve the effect of seeing
> dust motes as glowing specks in a light ray. I tried
> using scattering media but then I also got black spots
> outside the light ray. Of course I could just restrict
> the container but I'm looking for a more "purist" way
> to understand how real dust motes work ;)

If you think about it, a dust mote is essentially clear
under normal conditions, the bright parts you see
in a light ray are the bright highlights.

#include "colors.inc"

camera {
   location  <0.0, 0.5, -4.0>
   direction 1.5*z
   right     x*image_width/image_height
   look_at   <0.0, 0.0,  0.0>
}

background {Black}

light_source {
  <0,10,0>
  color <1,1,1>*3
  spotlight
  point_at <0,-1,0>
  radius 2.5
  falloff 5
}

#default {finish{ambient 0 diffuse 1}}

plane {y,-1 pigment{checker White Blue}}

box { // media container
   <-2,-1,-2>,<2,9.9,2>
   hollow
   material {
      texture {
         pigment {
            Clear
         }
      }
      interior {
         media {
            scattering {
               1,<1,1,1>*0.2
            }
         }
      }
   }
}

#declare mote = triangle {
   <0,0,0>,<0.01,0,0>,<0,0.01,0.005>
   hollow // hollow is important because of the media
   texture {
      pigment {Clear}
      finish{
         specular 1
         roughness 0.5
      }
   }
};
#declare s = seed(1);
#declare c = 0;
#while (c<5000)  
   #declare loc = <rand(s)*4-2,rand(s)*4-0.99,rand(s)*4-2>;
   object {mote 
      rotate <0,rand(s)*360,0>
      translate loc
   }
   #declare c=c+1;
#end


Post a reply to this message

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