//snowmen scene //Kurt Bangert //http:://www.travelnotes.de #include "colors.inc" #include "textures.inc" #include "woods.inc" #include "stones.inc" global_settings { max_trace_level 100 } //a texture for plastic cover #declare Glass2 = texture { pigment { rgbf <1,1,1,1> } finish { ambient 0 diffuse 0 reflection 0.5 refraction 0.85 ior 1.5 phong 0.3 phong_size 60 } } //a texture for falling snow #declare frac = 0.033 //fraction of texture covered with White #declare frac1= frac+0.001 #declare falling_snow = texture { pigment { radial color_map { [ 0.00 color Clear ] [ 0.5-frac1 color Clear ] [ 0.5-frac color White ] [ 0.5+frac color White ] [ 0.5+frac1 color Clear ] [ 1.00 color Clear ]} turbulence 1 octaves 6 omega 8 } finish { Luminous } } //a texture for the hat #declare hat_texture = texture { pigment {Gray95} finish {ambient .1 diffuse .1}} //snow on the ground #declare snow_patch = object { blob { threshold 0.5 component 1,.6, <-2.5, .5, 0> component 1,1 <2.5, 0, -2> component 1,1, <-2, .4, 0> component 1,1.3, <2, 0, -2> component 1,1.2, <-1.5, 0, 0> component 1,.8, <1.2, .3, -2> component 1,1.1, <0, 0, 0> component 1,1.1, <0, 0, -2> component 1,.8, <1.2, .3, 0> component 1,1.2, <-1.5, 0, -2> component 1,1.3, <2, 0, 0> component 1,1, <-2, .4, -2> component 1,1 <2.5, 0,-.5> component 1,2, <-2.5, .5, -2> component 1,.8, <1., .3, -1> component 1,.8, <1.2, .3, .5> texture { pigment { White } finish { ambient .7 diffuse .3 }}} } #declare water_patch = object { blob { threshold 0.5 component 1,.6, <-2.5, .5, 0> component 1,1 <2.5, 0, -2> component 1,1, <-2, .4, 0> component 1,1.3, <2, 0, -2> component 1,1.2, <-1.5, 0, 0> component 1,.8, <1.2, .3, -2> component 1,1.1, <0, 0, 0> component 1,1.1, <0, 0, -2> component 1,.8, <1.2, .3, 0> component 1,1.2, <-1.5, 0, -2> component 1,1.3, <2, 0, 0> component 1,1, <-2, .4, -2> component 1,1 <2.5, 0,-.5> component 1,2, <-2.5, .5, -2> component 1,.8, <1., .3, -1> component 1,.8, <1.2, .3, .5> interior { ior 1.3} pigment { Clear } finish { reflection .1 }} } //black coal #declare coal = sphere {<0,0,0> .17 pigment { Gray90 } scale <1,1,.5> normal { bumps 1 scale 0.05 }} //assemble the Snow Man #declare SnowMan = union { //body sphere { <0, 1.9, 0> 2 scale <1,.9,1> } object { object { coal translate <0,0,-2> } rotate x*30 translate y*1.9 } object { object { coal translate <0,0,-2> } rotate x*10 translate y*1.9 } sphere { <0, 4.4, 0> 1.2 scale <1,.9,1> } object { object { coal translate <0,0,-1.2> } rotate x*30 translate y*4.4 scale <1,.9,1> } object { object { coal translate <0,0,-1.2> }rotate x*0 translate y*4.4 scale <1,.9,1> } object { torus {1.5,.3} scale <1,.6,1> rotate x*90 translate <0,3.2,0> } //head sphere { <0, 5.7, 0> .8 } object { object { coal scale <.7,.7,.3> translate <0,0,-.8> } rotate <20,20,0> translate y*5.7 } object { object { coal scale <.7,.7,.3> translate <0,0,-.8> } rotate <20,-20,0> translate y*5.7 } object { object { coal scale .2 translate <0,0,-.8> } rotate <-27,-20,0> translate y*5.7 } object { object { coal scale .2 translate <0,0,-.8> } rotate <-29,-10,0> translate y*5.7 } object { object { coal scale .2 translate <0,0,-.8> } rotate <-30, 0, 0> translate y*5.7 } object { object { coal scale .2 translate <0,0,-.8> } rotate <-29, 10,0> translate y*5.7 } object { object { coal scale .2 translate <0,0,-.8> } rotate <-27, 20,0> translate y*5.7 } //hat with snow ellipsoids disc { <0,6.3,0> <0,1,.1> 1 texture { hat_texture }} object { sphere {<0,0,0> .95 } clipped_by { plane{-y,0} } scale <1,.15,1> rotate x*10 translate y*6.3 } cylinder { <0,6.3,0><0,7.0,.07> .6 texture { hat_texture }} cylinder { <0,6.3,0><0,7.01,.07> .61 texture { falling_snow }} object { sphere{<0,0,0> .59 } scale <1,.15,1> rotate x*10 translate y*7 } //nose cone { <0, 5.7,-.7> .15 <0,5.4,-1.3> 0 pigment { Red }} pigment { color White} finish { ambient .7 diffuse.3 } normal { bumps 0.6 scale 0.2 } } //--------------- //The scene light_source { <20, 30, -10> color White } camera { location <6,12,-23> look_at <6,5,0> } object {box{<-100,-1,20><100,100,21>} texture{pigment{color rgb< .5,.5,1>} normal {bumps 0.2 scale .3} }} object {box{<-100,-1,-11><100,0,100>} texture{T_Wood7 scale 4 translate x*5 rotate x*0 rotate y*90 rotate z*5}} background{Gray50} //snowman object { SnowMan scale 1.5 rotate y*20 translate <0,0,0> } //the plastic covering the snowman #declare outer_cover=object{ difference{ merge{object {cylinder{<0,0,0><0,8,0> 6}} object {sphere{<0,8,0> 6.0001}}} object {cylinder{<0,-.1,0><0,8,0> 5.9}} object {sphere{<0,8,0> 5.90001}}} texture{ pigment{ color rgbt<1, 1, 1, 0.99>} finish{reflection 0.15 ambient 0 diffuse 0 phong .5 phong_size 200 }} interior{ior 1.1 fade_distance 300 fade_power .15+.15 caustics 1} } object{outer_cover} //the water inside with the snow texture #declare inner_part= object{ merge{ object {cylinder{<0,0,0><0,8,0> 5.8 }} object {sphere{<0,8,0> 5.8001 }}} texture { falling_snow scale 2} interior{ior 1.3 fade_distance 300 fade_power .15+.15 caustics 1 }} object {inner_part} //baseplate #declare baseplate=union{ object {cylinder{<0,0,0><0,.5,0> 6} pigment{Green} } object {cylinder{<0,0,0><0,.6,0> 5.9} pigment{Green} } } object {baseplate} object { difference{ cylinder{ <0,0,0><0,1,0> 5.81 pigment {White} finish {ambient 0.7 diffuse 0.3}} union{ object{snow_patch scale <2,.5,2> translate <0,1.0,5>} object{snow_patch scale <2,.5,2> translate <8,1.0,5>} object{snow_patch scale <2,.5,2> translate <0,1.0,0>} object{snow_patch scale <2,.5,2> translate <4,1.0,2>} }}} //down from here the parts of the molten snowman object{water_patch scale <2,1,2> translate <12,0.1,-4>} object{baseplate translate <16,0,6>} object{outer_cover rotate -z*94 rotate -y*40 translate <14,6.7,6>} cone { <10, .2,-4.7> .2 <10,0,-5.5> 0 pigment { Red }} #declare hat=union{ disc { <0,6.3,0> <0,1,0> 1 texture { hat_texture }} cylinder { <0,6.3,0><0,7.0,0> .6 texture { hat_texture }} } object{hat scale 1.2 translate <9.8,-7.55,-1.1>} object { object { coal scale 1.2 rotate x*10 translate <11.2, 0, -1.2>} translate y*.17 } object { object { coal scale 1.2 rotate x*40 translate <10.45,0, 1.8>} translate y*.17 } object { object { coal scale 1.2 rotate x*30 translate <11.7, 0, -1.7>} translate y*.17 } object { object { coal scale 1.2 rotate x*50 translate <9.3, 0, 1.1>} translate y*.17 } object { object { coal scale 1.2 rotate x*20 translate <11.3, 0, -1.6>} translate y*.17 } object { object { coal scale 1.2 rotate x*0 translate <11.4, 0, -0.3>} translate y*.17 } object { object { coal scale .5 translate <12.2,.13,-1.2> }} object { object { coal scale .5 translate <11.5,.13,-.8> }} object { object { coal scale .5 translate <12.2,.13,-.8> }} object { object { coal scale .5 translate <12.4,.13,-1.4> }} object { object { coal scale .5 translate <12.4,.13,-2.1> }} //end of scene