// Persistence of Vision Ray Tracer Scene Description File // File: snowmelt.pov // Vers: 3.5 // Desc: Picture of Snowman melting. Illustrates the use of macros // in animation. // Date: Nov 02 // Auth: Jenny Orr // Standard pre-defined colors // #include "colors.inc" // set a color of the background (sky) background { color rgb <1,.8,.6> } fog { distance 20 color .3*<1,.8,.6> } // perspective (default) camera camera { location <0.0, 1.0, -7.0> look_at <1.4, 2.0, 0.0> } // create a regular point light source light_source { <4, 15, -5> // light's position (translated below) color 2*White } // create a regular point light source light_source { .3*<0, 5, -50> // light's position (translated below) color Sienna } //************** SNOWMAN MACRO ****************************** // The height determines how much to shrink the snowman along // the y-direction. Note that the body of the snowman is scaled // while the hat, arms, etc are just moved. #macro snowman(height) union { // snowman bottom sphere { <0, 1, 0> // center of sphere 1 // radius of sphere texture { pigment { color White } } scale height*y } // snowman middle sphere { <0, 2.3, 0> // center of sphere .7 // radius of sphere texture { pigment { color White } } scale height*y } // snowman head sphere { <0, 3.2, 0> // center of sphere .5 // radius of sphere texture { pigment { color White } } scale height*y } // snowman arms cylinder { <1.6, 2.3, 0>,<-1.6, 2.3, 0> .1 texture { pigment { color Brown } } translate -2.3*(1-height)*y } // snowman eye 1 sphere { <.2, 3.25, -.5> // center of sphere .1 // radius of sphere texture { pigment { color Black } } translate -3.25*(1-height)*y } // snowman eye 2 sphere { <-.2, 3.25, -.5> // center of sphere .1 // radius of sphere texture { pigment { color Black } } translate -3.25*(1-height)*y } // snowman nose cone { <0, 3.15, -.5>, .1, <0, 3.25, -.7>, 0.0 texture { pigment { color Orange } } translate -3.15*(1-height)*y } // hat top cylinder { <0, 3.6, 0> , <0, 4.2, 0> , .3 texture { pigment { color Green } } translate -3.6*(1-height)*y } //hat rim cylinder { <0, 3.6, 0> , <0, 3.61, 0> , .6 texture { pigment { color Green } } translate -3.6*(1-height)*y } } #end // end of macro //************** END SNOWMAN ************************************ // Here is a snowman that doesn't melt object { snowman(1) } // Here is a melting snowman object { snowman(1-clock+.001) translate <4,0,0> } // An infinite planar surface // plane {, D } where: A*x + B*y + C*z = D plane { y, // unit surface normal, vector points "away from surface" 0.0 // distance from the origin in the direction of the surface normal texture { pigment { color Gray } } }