POV-Ray : Newsgroups : povray.text.scene-files : Proximity pattern demo : Proximity pattern demo Server Time
28 Jul 2024 16:27:03 EDT (-0400)
  Proximity pattern demo  
From: Chris Huff
Date: 4 Feb 2000 15:47:26
Message: <chrishuff_99-43768E.15482004022000@news.povray.org>
//Here is a quick-n-cheap demo of my proximity pattern...
//*******************************************
#include "colors.inc"
#version unofficial MegaPov 0.4;
//-------------------------------------------
camera {
   location < 2, 8,-20>
   look_at < 0, 0, 0>
   angle 35//30
}
//*******************************************


#declare Prox =
difference {
   sphere {< 0, 0, 0>, 5}
   cylinder {< 0, 0,-5.1>, < 0, 0, 5.1>, 2.5}
   box {< 0, 0,-5.1>, < 5.1, 5.1, 5.1>}
   texture {
      pigment {color White*0.35}
      finish {brilliance 2}
   }
}

object {Prox}

sphere {< 0, 0, 0>, 7.5 hollow
   texture {
      pigment {color White filter 1}
   }
   interior {
      media {
         emission color Green*0.5
         intervals 1 samples 15, 15
         confidence 0.99 variance 1/128
         method 3
         density {
            proximity {Prox, 1
               samples 40
               max_density 1
               type 1//minimum distance
//             method 0//point in BBox
               method 1//Always use random direction.
                       //Slower, but pretty fast because all
                       //points are prety close to Prox
               sides 1//Outside only
            }
            color_map {
               [0 color Black]
//Since only the outside is being calculated, all points
//inside the object are set to 0.
//We want the color to range from 1 at the surface(distance 0)
//to 0 as the distance increases, and the inside to be 0. That
//is the reason for this short entry at the beginning of the
//color_map.
               [0.01 color White]
               [1 color Black]
            }
         }
      }
   }
}

//*******************************************

light_source { < -30, 55, -40>*100 color White*0.8}
light_source { < 10, 15, -30>*100 color White*0.4}

//-------------------------------------------

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

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