POV-Ray : Newsgroups : povray.binaries.images : Transition between two medias : Re: Transition between two medias Server Time
30 Jul 2024 08:26:57 EDT (-0400)
  Re: Transition between two medias  
From: Christian Froeschlin
Date: 24 Apr 2012 06:58:43
Message: <4f968763@news.povray.org>
Thomas de Groot wrote:

> I would prefer a more diffuse approach using a spherical pattern for 
> instance, but I am unable to come up with a working code that can do 
> that properly.

are you looking for something like this:

#declare f_gradient_x_non_repeating = function
{
   select(x,0,select(x-1,x-1,1))

   // of course you can also construct something using
   // f_spherical here depending on desired geometry
}

box
{
   <-2,-1,0>,<2,1,1> hollow
   pigment  {color rgbt 1}
   interior
   {
     media
     {
       method 3
       absorption 10
       density
       {
         function {f_gradient_x_non_repeating(x,y,z)}
         translate -0.5*x
         scale 2*x
         rotate 45*z
         color_map
         {
           [0.0 color Navy]
           [1.0 color Khaki]
         }
       }
     }
   }
}


Post a reply to this message

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