// POVRay script to illustrate caustics // Jacob Dilles - George Mason University // jdilles@gmu.edu // September 2009 // ------------------------------------------------------------------ // Global settings enable photons // ------------------------------------------------------------------ global_settings { assumed_gamma 1.0 photons { count 8000000 // Max # of photons used in scene. autostop 0 jitter .4 radius ,1.15 } } // ------------------------------------------------------------------ // Camera is fixed, slightly to the left of the target, looking at it // ------------------------------------------------------------------ camera { location <8, 4, 12.0> up z sky z look_at <0.0, 0.0, 0.5> angle 50 } // ------------------------------------------------------------------ // Light source rotates in a an arc of D radius in accordance with the // *clock* variable. Thus clock 0-pi/2 will run a 90 degree arc // in the animation sequence // // Note, light source needs the photons{} to emit them // ------------------------------------------------------------------ light_source { *10 color rgb <2.2, 1.8, 1.5> photons { refraction on reflection on } spotlight point_at <0,0,1> radius 15 falloff 25 } // ------------------------------------------------------------------ // The plane is not very reflective, but it must diffuse light or else // the caustic will not be visible at all! It alternates between white // and grey in a checkerboard pattern. This turns out nicer than the // white on black since black doesn't reflect much light. // // Note: The plane must be a photon target, else no caustic results, // only ray-trace results, and that misses the point // ------------------------------------------------------------------ plane { z, 0 texture { pigment { checker color rgb 1, color rgb 0.8 } finish { reflection 0.3 diffuse 0.3 specular 0.4 } } photons { target collect on reflection off refraction off } } // ------------------------------------------------------------------ // This code creates the semi-circular mirror. // // It is the difference of a large cylinder (outside diameter) - // smaller cylinder (inside diameter) - box (which cuts off the front) // // It's got a reflective finish and the specular setting gives good // effect to the photons for caustics // // Note that in the photons block, we enable both refraction and // reflection, which together cause the caustic // ------------------------------------------------------------------ difference { cylinder { <0, 0, 0> , <0,0, 3> , 2 } cylinder { <0, 0, -1> , <0,0, 30> , 1.95 } box { <4, -3, 0>, <0,3,30> } texture { pigment { color rgb 1 } finish{ diffuse 0.0 ambient 0.01 //metallic // no longer needed specular 0.6 reflection 0.5 } } photons { target refraction on reflection on collect on } }