POV-Ray : Newsgroups : povray.newusers : How to create a beam inside a glass? : Re: How to create a beam inside a glass? Server Time
29 Jul 2024 18:23:47 EDT (-0400)
  Re: How to create a beam inside a glass?  
From: Ziyan
Date: 22 May 2005 08:40:01
Message: <web.42907cbf4282c60c90ff0fdd0@news.povray.org>
Thank you, Bob and Stephen for all your help. I'm so appreciated when you
could solve my problem as I'm layman and not familiar with POV.

I created an object as following

#declare A = merge {object{cylinder {55*z,65*z,0.4}}
                    object{box {<-0.4,-0.25,55>,<0.4,0.25,65>}
                           translate 0.25*y  }}

#declare B = difference{box {<-0.5,-0.5,55>,<0.5,0.5,65>}
                        object {A}}

A with ior=1.55 and B with ior=1.438

now I want to create a beam through this object to simulate the refraction
and get the beam which comes out from the object.

I utilized all your work and made this, but it seems to be wrong.

global_settings {
  adc_bailout 0.003922
  ambient_light <1.0,1.0,1.0>
  assumed_gamma 1.9
  hf_gray_16 off
  irid_wavelength <0.247059,0.176471,0.137255>
  max_intersections 64
  max_trace_level 10
  number_of_waves 10
  noise_generator 2
  charset ascii
  photons {
    adc_bailout       0.01
    spacing           1.0
    gather            20, 100
    media             0, 1.0
    jitter            0.4
    max_trace_level   5
    autostop          0.5
    radius            0.0
    expand_thresholds 0.2, 35.0
  }
}


//Camera
camera {
         location <0,0,67>
         angle 120
         up 1*y
         right 1.333*x
         look_at <0,0,66>
         translate <-27.5,0,0>
         }

background { color rgb <0, 0, 0> }

//Scattering

#declare Scattering =
   material  // Scattering
   {
      texture
      {
         pigment
         {
            color rgbt <0.531233, 0.531233, 0.531233, 1.0>
         }
      }
      interior
      {
         media  // MyAtmosphere_1_1
         {
            variance 1.0/128.205128
            scattering
            {
               1 ,  rgbt <0.03, 0.03, 0.03, 1.0> // isotropic scattering
               extinction 0.25
            }
         }
      }
   }


#declare Scattering_1 =
   material  // cylinder object
   {
      texture
      {
         pigment
         {
            color rgbt <0.0, 0.0, 0.0, 1.0>
         }
      }
      interior
      {
         ior 1.55
         media  // MyAtmosphere_1_1_1
         {
            variance 1.0/128
            scattering
            {
               1 ,  rgb <0.5, 0.5, 0.5> // less scatter now
               extinction 0.5 // more extinction here
            }
         }
      }
   }


#declare Scattering_2 =
   material  // cylinder object
   {
      texture
      {
         pigment
         {
            color rgbt <0.0, 0.0, 0.0, 1.0>
         }
      }
      interior
      {
         ior 1.438
         media  // MyAtmosphere_1_1_1
         {
            variance 1.0/128
            scattering
            {
               1 ,  rgb <0.5, 0.5, 0.5> // less scatter now
               extinction 0.5 // more extinction here
            }
         }
      }
   }


//Checker

#declare Checkered_1 =
   material  // Checkered_1
   {
      texture
      {
         pigment
         {
            checker
               color rgb <0.882353, 0.882353, 0.882353>
               color rgb <0.952941, 0.952941, 0.952941>

         }
         finish
         {
            ambient 0.1
         }
         scale  6.0
      }
   }


//Lights

light_source {   // Light001
  <0.0, 0.0, 0.0>
  color rgb <1.000, 1.000, 1.000>
  media_interaction off
  photons {
  }
  translate  <2, 2, 0>
}


light_source {<0, 0, 90>
    color rgbt Red*10
    spotlight
    falloff 0.268  // outer radius (in deg)
    radius     0.238
    tightness  0.000
    point_at <0,.5,68>
    photons {refraction on reflection on}
    media_attenuation on
    translate <-27.5,-0.25,0>
}

box{<-5,-5,-80>, < 5, 5, 80>
    material {
    Scattering
  }
  hollow
    translate -27.5*x
}



//Plane
plane { // Plane001
  y,-2
  material {
    Checkered_1
  }
  photons {
    target 1.0
  }

}

//Object

#declare A = merge {object{cylinder {55*z,65*z,0.4}}
                    object{box {<-0.4,-0.25,55>,<0.4,0.25,65>}
                           translate 0.25*y  }}


#declare B = difference{box {<-0.5,-0.5,55>,<0.5,0.5,65>}
                        object {A}}

object {A
        translate <-27.5,0,0>

        material {
    Scattering_1
  }
  hollow
  photons {
    reflection on
    refraction on
  }
        }

object { B
         translate <-27.5,0,0>

         material {
    Scattering_2
  }
  hollow
  photons {
    reflection on
    refraction on
  }
 }

Any ideas?
Thank you again.


Post a reply to this message

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