//========================================= // Half-full glass for Pov-ray 3.1 & higher // (c) 1999 Gilles Tran tran@inapg.inra.fr //----------------------------------------- // This glass was used in "The Cubicle Workers" ("La vie de bureau") // and "The Drink" ("Le verre de l'amitié"). //----------------------------------------- // Beware : this can take FOREVER to render ! // If you crank up the max_trace_level parameter to a high value, such as 20, // the picture will be brighter, but you'll probably be retired when it's over // unless you got a Cray, that is. // max_trace_level = 15 is ok, but awfully slow still // you can accelerate the render by setting a low adc_bailout in global_settinggs //========================================= // MakeGlass macro //----------------------------------------- #macro MakeGlass(eGlass,colLiquid,dotest) // colLiquid = color of liquid // eGlass = glass thickness // dotest= test flag 0=no test 1=test //----------------------------------------- #local eps=0.001; union{ // Glass lathe{ cubic_spline 22, // # of points <-0.5,0.1>,<0,0>,<4.6,0>,<4.4,0.5>,<1.5,0.7>,<0.8,1.8>,<1.3,2.5>, <1,3>,<0.8,4>,<1,5>,<3,6.5>,<4.5,8>,<5.2,10>,<5,12>,<4.8,15>, <4.3,14.7>,<5-eGlass,12>,<5.2-eGlass,10>,<4.5-eGlass,8>,<3-eGlass,6.5>, <0,5.4>,<-1,5.4> sturm #if (dotest=1) texture{pigment{rgbf <0.8,0.8,0.8,0.9>} finish{phong 1}} #else texture{ pigment{rgbt<1, 1, 1, 0.9>} finish{reflection 0.1 ambient 0 diffuse 0 phong 1 phong_size 200 } } interior{ior 1.5 fade_distance 5 fade_power 0 caustics 4} #end } // vodka, cognac whatever lathe{ cubic_spline 9, // # of points <-1,11.5>,<0,11.5>,<3.9-eps,11.7>,<5-eGlass-eps,12>,<5.2-eGlass-eps,10>, <4.5-eGlass-eps,8>,<3-eGlass-eps,6.5>,<0,5.4+eps>,<-1,5.4+eps> sturm #if (dotest=1) texture{pigment{rgb<1,0,0>}} #else texture{ pigment{colLiquid} finish{reflection 0.1 ambient 0 diffuse 0 phong 1 phong_size 200} } interior{ior 1.33 caustics 4} #end } } #end //========================================= // Glass example //----------------------------------------- #include "colors.inc" //global_settings{max_trace_level 15} //global_settings{max_trace_level 5} #declare PdV=<0, 160, -150.0>; camera {location PdV right 4*x/3 up y direction 7.5*z look_at 5*y} light_source { <100, 300, -250> color rgb 2} light_source { <-250, 300, -50> color rgb 2/6} #declare rC=1.5; #declare colLiquid=color rgbf; #declare eGlass=0.2; #declare dotest=0; object{MakeGlass(eGlass,colLiquid,dotest)} background{White}