POV-Ray : Newsgroups : povray.general : Optical cloaking : Re: Optical cloaking Server Time
8 Jul 2024 13:15:45 EDT (-0400)
  Re: Optical cloaking  
From: omniverse
Date: 9 Oct 2014 03:00:01
Message: <web.543631939d3a84f4211620b20@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Maybe someone with free time could look into this and model it.
 Sure thing, free time used up now!  :) Just a hack but I think it's basically
what they're doing if I understood it right. Objects avoiding the narrow
refracted area are not seen. No idea how each lens is shaped but this scene file
seems to do the trick, aside from edge distortion which could possibly be
reduced or eliminated by either increasing lens size within rings or thickening
the rings.

// BEGIN SCENE
/* imitating cloaking lenses, BGH 2014.77 */

/* NOTE: use first command line when PhotonsMedia=yes for faster render */

//cmd: +w160 +h120

//cmd: +w512 +h384 +a

#version 3.7;

#local PhotonsMedia=no; // side view with light beams?

#local Overview=no; // a look from above front?

global_settings
{
 assumed_gamma 1
 max_trace_level 11
#if (PhotonsMedia=yes)
  photons {
    //count 333333
    spacing 0.3
    media 333, 1
    autostop 0
    jitter 0.3
  }
#else #end
}

#if (PhotonsMedia=no)
light_source
{
 -99*z,1
 rotate <45,45,0>
 media_interaction off
 photons
 {
  reflection off
  refraction off
 }
}
#else #end

#if (PhotonsMedia=yes)
light_source
{
 -33*z,3
 parallel
 spotlight
 radius 0.1
 falloff 0.13
 point_at 0
 media_interaction on
 photons
 {
  reflection off
  refraction on
 }
}
#else #end

// view
camera
{
#if (PhotonsMedia=yes)
 location <50,0,15>
 look_at <0,0,15>
 angle 45
#else
#if (Overview=yes)
 location <0,12.5,-25>
 look_at <0,0,5>
#else
 location <0,0,-25>
 look_at <0,0,0>
#end
 angle 33
#end
 up y
 right 4/3*x
}

// room
box
{
 -1,1
 scale 100
 material
 {
 texture
 {
  pigment
  {
   gradient x
   color_map
   {
    [0.1 rgb <0.1,0.1,0.9>]
    [0.15 rgb <1,1,1>]
   }
  }
 }
 texture
 {
  pigment
  {
   gradient y
   color_map
   {
    [0.1 rgb <0.1,0.9,0.1>]
    [0.15 rgbt <1,1,1,1>]
   }
  }
 }
#if (PhotonsMedia=yes)
 interior
 {
  media
  {
   scattering
   {
    1, <0.1,0.01,0.1>
   }
   method 3
   intervals 1
   samples 33
  }
 }
#else #end
 }
 translate -33*z
 hollow on
#if (PhotonsMedia=yes)
 photons
 {
  target
  //collect on
  //reflection off
  //refraction on
 }
#else #end
}

// test object between lenses
box
{
 -1,1
 scale <9,0.5,0.1>
 material
 {
  texture
  {
   pigment
   {
    rgb <1,0.01,0.01>
   }
  }
 }
 translate <0,1,10>
}


// lens 1
union
{
 difference
 {
  cylinder
  {
   -1*z,1*z,3.33
  }
  cylinder
  {
   -1.01*z,1.01*z,3
  }
  material
  {
   texture
   {
    pigment
    {
     rgb <0,0,0>
    }
   }
  }
 }

sphere
{
 0,1
 scale <5,5,1>
 clipped_by
 {
  cylinder
  {
   -1.01*z,1.01*z,3
  }
 }
 material
 {
  texture
  {
   pigment
   {
    rgbt <1,1,1,1>
   }
   finish
   {
    emission 0.1
    diffuse 0
   }
  }
   interior
   {
    ior 2.5
   }
 }
}
#if (PhotonsMedia=yes)
photons
{
 target
 collect on
 reflection off
 refraction on
}
 hollow on
#else #end
 translate <0,0,0>
}

// lens 2
union
{
 difference
 {
  cylinder
  {
   -1*z,1*z,3.33
  }
  cylinder
  {
   -1.01*z,1.01*z,3
  }
  material
  {
   texture
   {
    pigment
    {
     rgb <0,0,0>
    }
   }
  }
 }

sphere
{
 0,1
 scale <5,5,1>
 clipped_by
 {
  cylinder
  {
   -1.01*z,1.01*z,3
  }
 }
 material
 {
  texture
  {
   pigment
   {
    rgbt <1,1,1,1>
   }
   finish
   {
    emission 0.1
    diffuse 0
   }
  }
   interior
   {
    ior 2
   }
 }
}
#if (PhotonsMedia=yes)
photons
{
 target
 collect on
 reflection off
 refraction on
}
 hollow on
#else #end
 translate <0,0,15>
}

// lens 3
union
{
 difference
 {
  cylinder
  {
   -1*z,1*z,3.33
  }
  cylinder
  {
   -1.01*z,1.01*z,3
  }
  material
  {
   texture
   {
    pigment
    {
     rgb <0,0,0>
    }
   }
  }
 }
difference
{
sphere
{
 0,1
 scale <5,5,1>
}
sphere
{
 0,1
 scale <10,10,1>
 translate <0,0,-0.25>
}
 clipped_by
 {
  cylinder
  {
   -1.01*z,1.01*z,3
  }
 }
 material
 {
  texture
  {
   pigment
   {
    rgbt <1,1,1,1>
   }
   finish
   {
    emission 0.1
    diffuse 0
   }
  }
   interior
   {
    ior 1.1
   }
 }
}
#if (PhotonsMedia=yes)
photons
{
 target
 collect on
 reflection off
 refraction on
}
 hollow on
#else #end
 translate <0,0,25>
}

// END SCENE


Post a reply to this message

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