/* * file cardboard_06.pov * desc A simple macro to do a banner based on a logo I've seen somewhere * ver 1.0.0 * date 07/02/2005 * auth Paolo Gibellini * ref The corrugated cardboard isosurface basic idea come from WikiPov * ref Ref: http://povray.tirnalong.com/ow.asp?CorrugatedIron * ref Warp sample on scattering media * todo Add some random in position of letter and dimension of holes * todo Add metal sticks to create the tense of hanging letters * todo A better way to center the letters * todo Make the letters brighter? * todo Try to avoid yellow color artifacts on the glasses (photons?) * note Better with one spotlight or with a spotlight per letter? */ #version 3.6; // Parameters --------------------------------- // Real parameters #declare word="POV"; // The word to be bannerized //#declare font="Tahoma"; // Font to be used #declare font="Comic"; // Font to be used #declare final_render=1; // 0 while working #declare one_spot=0; // 1 one spotlight, 0 one for each letter // Misc stuff #declare n_letters=strlen(word); #declare axis_on=0; // Show axis while working // Dimension of the cardboard scaled by 10 #declare ct=15; #declare cl=-10*n_letters; #declare cb=-15; #declare cr=10*n_letters; // -------------------------------------------- // Camera ------------------------------------- // Semi-adaptive to the length of the word camera { location <-3, -2, -n_letters*1.6> // location <-1, 5, 0> look_at <0.0, 0.0, 0.0> } // -------------------------------------------- // Lightning ---------------------------------- #if (final_render=0) global_settings { assumed_gamma 1.0 } media { scattering { 5, .1 extinction .1 eccentricity .4 } } // A light light_source { <5, 3, -9>, .3 media_interaction off shadowless } // Spotlights #if(one_spot=1) // A spotlight light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color spotlight // this kind of light source translate *1.2 // position of light point_at <0, 0, 0> // direction of spotlight radius 5 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 6 // intensity falloff radius (outer, in degrees) } #else // Some spotlights #declare i=0; #while (i // light's color spotlight // this kind of light source translate *1.2 // position of light //translate *1.5 // position of light point_at <(cl/10+(cr-cl)*(i+.5)/(10*n_letters))-0.5,0,-1>*0.8 // direction of spotlight radius 5 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 6 // intensity falloff radius (outer, in degrees) } #declare i=i+1; #end #end #else global_settings { ambient_light <0, 0, 0> assumed_gamma 1.0 radiosity { pretrace_start 0.08 // start pretrace at this size pretrace_end 0.04 // end pretrace at this size count 35 // higher -> higher quality (1..1600) [35] nearest_count 5 // higher -> higher quality (1..10) [5] error_bound 1.8 // higher -> smoother, less accurate [1.8] recursion_limit 3 // how much interreflections are calculated (1..5+) [3] low_error_factor .5 // reduce error_bound during last pretrace step gray_threshold 0.0 // increase for weakening colors (0..1) [0] minimum_reuse 0.015 // reuse of old radiosity samples [0.015] brightness 1 // brightness of radiosity effects (0..1) [1] adc_bailout 0.01/2 //normal on // take surface normals into account [off] //media on // take media into account [off] //save_file "file_name" // save radiosity data //load_file "file_name" // load saved radiosity data //always_sample off // turn sampling in final trace off [on] //max_sample 1.0 // maximum brightness of samples } } media { scattering { 5, .1 extinction .1 eccentricity .4 } } // A light light_source { <5, 3, -9>, .3 media_interaction off shadowless } // Spotlights #if(one_spot=1) // A spotlight light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color spotlight // this kind of light source translate *1.2 // position of light point_at <0, 0, 0> // direction of spotlight radius 5 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 6 // intensity falloff radius (outer, in degrees) } #else // Some spotlights #declare i=0; #while (i // light's color spotlight // this kind of light source translate *1.2 // position of light //translate *1.5 // position of light point_at <(cl/10+(cr-cl)*(i+.5)/(10*n_letters))-0.5,0,-1>*0.8 // direction of spotlight radius 5 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 6 // intensity falloff radius (outer, in degrees) } #declare i=i+1; #end #end /* // An area light light_source { 0*x // light's position (translated below) color rgb 1.0 // light's color area_light *1.2 *1.2 // lights spread out across this distance (x * z) 4, 5 // total number of lights in grid (4x*4z = 16 lights) adaptive 0 // 0,1,2,3... jitter // adds random softening of light circular // make the shape of the light circular orient // orient light translate <5, 0, -10> // position of light } */ #end // -------------------------------------------- // Textures ----------------------------------- #declare t_paper02=texture { pigment { granite color_map { [ 0.0 rgbft <0.670588, 0.505882, 0.321569, 0.0, 0.0> ] [ 1.0 rgbft <0.941176, 0.878431, 0.792157, 0.0, 0.0> ] } turbulence 0.75 ramp_wave scale 0.1 } } #declare t_orangeglass=texture { pigment{rgbf <1,0.5,0,0.8>} finish { /* ambient 0.9 diffuse 0.7 brilliance .8 reflection .55 specular 1 roughness 0.001 */ ambient 0.1 diffuse 0.5 brilliance .8 reflection 0.3 specular 0.8 roughness 0.001 } } // -------------------------------------------- // Corrugated cardboard ----------------------- #declare Thickness = 0.1; #declare Corr_Iron = function(x,y,z) { abs(y-cos(x))-(Thickness/2) } #declare corr_card=isosurface { function {Corr_Iron(x, y, z) } contained_by { box {,} } accuracy 0.001 max_gradient 4 } #declare plane_card=box {,} // The vertical cardboard #declare corrugated_cardboard=union { object {corr_card} object {corr_card rotate <0,0,180> translate <(cl+cr),1.8,0>} object {plane_card translate <0,0.9,0>} object {plane_card translate <0,-0.9,0>} object {plane_card translate <0,2.7,0>} scale 0.1 } // Cut profile #declare cut_profile=union { cylinder {<(cl+cr)/2,-18,(ct+cb)/2> <(cl+cr)/2,+18,(ct+cb)/2> 1.1 scale /2} scale 0.1 } // Inner cut profile #declare i=0; #declare inner_cut_profile=union { #while (i*.8 *.8 0.9 } #declare i=i+1; #end }; // -------------------------------------------- // Scene--------------------------------------- // Corrugated cardboard difference { object {corrugated_cardboard translate <0,-1,0>} object {cut_profile inverse} object {inner_cut_profile} rotate<90,0,0> translate <0,0,0.9> texture{t_paper02} } // Letters #declare i=0; #while (i*0.8 } #declare i=i+1; #end // Axis #if(axis_on=1) #include "colors.inc" cylinder {-10*x 10*x 0.1 pigment{Yellow}} cylinder {-10*y 10*y 0.1 pigment{Yellow}} cylinder {-10*z 10*z 0.1 pigment{Yellow}} // Cardboard bounds sphere { 0.1 pigment{Yellow}} sphere { 0.1 pigment{Yellow}} sphere { 0.1 pigment{Yellow}} sphere { 0.1 pigment{Yellow}} #end // --------------------------------------------