// Scene file by Matt Kruse // 1cm = 1 unit #include "colors.inc" // taken from textures.inc #declare Chrome_Metal = texture {pigment{color LightGray} finish {ambient 0.3 diffuse 0.7 reflection 0.15 brilliance 8 specular 0.8 roughness 0.1 } } #declare White_Plastic= texture { pigment {color White} finish {ambient .2 reflection .07 phong .4} } #declare Bar_Texture= texture { finish { ambient .2 reflection .30 metallic phong .5 } pigment {color White} } #declare Key_Texture= texture { finish { ambient .15 reflection .15 phong .8} pigment {color White} } #declare Blue_Plastic=texture {pigment {color SkyBlue} finish {ambient .25 phong .4 reflection .04} } #declare Bar_Distance=4.2 // BEGIN blue plastic part #declare Key_Plate=difference { box { <0,0,0> , <34.4,4.2,.2> texture {Blue_Plastic} translate <-2.625,-5.5,-8.01>} box { <-.25,-5.2,-9> , <.25,0,-6> texture {Blue_Plastic} translate x*Bar_Distance*0 } box { <-.25,-5.2,-9> , <.25,0,-6> texture {Blue_Plastic} translate x*Bar_Distance*1 } box { <-.25,-5.2,-9> , <.25,0,-6> texture {Blue_Plastic} translate x*Bar_Distance*2 } box { <-.25,-5.2,-9> , <.25,0,-6> texture {Blue_Plastic} translate x*Bar_Distance*3 } box { <-.25,-5.2,-9> , <.25,0,-6> texture {Blue_Plastic} translate x*Bar_Distance*4 } box { <-.25,-5.2,-9> , <.25,0,-6> texture {Blue_Plastic} translate x*Bar_Distance*5 } box { <-.25,-5.2,-9> , <.25,0,-6> texture {Blue_Plastic} translate x*Bar_Distance*6 } box { <-.25,-5.2,-9> , <.25,0,-6> texture {Blue_Plastic} translate x*Bar_Distance*7 } } // end of difference (key plate) #declare Blue_Part= union { box { < 0, 0, 0 >, < 1, 1, 1 > scale < 40, 3.5, 23.8 > translate < 0, 0, 0 > texture {Blue_Plastic} } intersection { union{ box { < 0, 0, 0 >, < 1, 1, 1 > scale < 2.5, 16.5, 23.8 > translate < 0, 0, 0 > texture {Blue_Plastic} } difference { box { < 0, 0, 0 >, < 1, 1, 1 > scale < 40, 16.5, 5.5 > translate < 0, 0, 18.3 > texture {Blue_Plastic} } plane {z,0 rotate x*10 translate <0,16.5,20.8> texture {Blue_Plastic} } } box { < 0, 0, 0 >, < 1, 1, 1 > scale < 2.5, 16.5, 23.8 > translate < 37.5, 0, 0 > texture {Blue_Plastic}} } sphere { < 0, 0, 0 >, 1 scale < 35, 16, 40 > translate < 20, -1, 23.8 > texture {Blue_Plastic}} } // end of intersection } //end of union // END Blue_Part // BEGIN main plastic part #declare Bump=difference { box { <0,0,-2.5> , <50,.8,0> } plane { -y,0 rotate x*-50 translate <0,.8,-1.7> } plane { -y,0 rotate x*40 translate <0,.8,0> } texture {White_Plastic} } #declare PLASTIC= union{ difference{ // This is the main Plastic Box union { box { <0,0,0> , <34.4, 2, 13.8> translate <-2.625,-3,-8.0> texture {White_Plastic} } cylinder { <0,1.7,0> , <34.4,1.7,0> , .3 translate <-2.625,-3,-8.0> texture {White_Plastic} } box { <0,1.2,-.3> , <34.4,1.7,-.3> translate <-2.625,-3,-8.0> texture {White_Plastic} } } intersection { plane { z,0 rotate y*1.4155 translate z*1.75 texture {White_Plastic} } plane { -z,0 rotate y*-1.4155 translate z*-1.75 texture {White_Plastic} } plane { -y,2.1 texture {White_Plastic} } } //End of intersection } //End of difference difference{ object {Bump translate x*-6 rotate y*-1.4155 translate <0,-1,-1.75> } plane { x,-2.625 texture {White_Plastic} } plane { -x,-31.775 texture {White_Plastic} } } difference{ object {Bump rotate y*180 translate <44,0,0> rotate y*1.4155 translate <0,-1,1.75> } plane { x,-2.625 texture {White_Plastic} } plane { -x,-31.775 texture {White_Plastic} } } } // end of PLASTIC union // END Main Plastic Part // BEGIN Keys #declare Key=union{ difference { box { <-.15,0,-3.3> , <.15,1.7,0> } plane {y,0 rotate x*13 } } // box { <-1,1.3,-4.3> , <1,2.1,-1.8> } union { // rounded box union box { <.2,.2,0> , <1.8,.6,2.5> } box { <0,.2,.2> , <2,.6,2.5> } box { <.2,0,.2> , <1.8,.8,2.3> } sphere { <0,0,0> , .2 translate <.2,.6,.2> } sphere { <0,0,0> , .2 translate <1.8,.6,.2> } sphere { <0,0,0> , .2 translate <.2,.6,2.3> } sphere { <0,0,0> , .2 translate <1.8,.6,2.3> } sphere { <0,0,0> , .2 translate <.2,.2,.2> } sphere { <0,0,0> , .2 translate <1.8,.2,.2> } sphere { <0,0,0> , .2 translate <.2,.2,2.3> } sphere { <0,0,0> , .2 translate <1.8,.2,2.3> } cylinder { <.2,.2,.2> , <.2,.6,.2> , .2 } cylinder { <1.8,.2,.2> , <1.8,.6,.2> , .2 } cylinder { <.2,.2,2.3> , <.2,.6,2.3> , .2 } cylinder { <1.8,.2,2.3> , <1.8,.6,2.3> , .2 } cylinder { <.2,.6,.2> , <1.8,.6,.2> , .2 } cylinder { <1.8,.6,.2> , <1.8,.6,2.3> , .2 } cylinder { <.2,.6,2.3> , <.2,.6,.2> , .2 } cylinder { <.2,.6,2.3> , <.2,.6,.2> , .2 } cylinder { <.2,.2,.2> , <1.8,.2,.2> , .2 } cylinder { <1.8,.2,.2> , <1.8,.2,2.3> , .2 } cylinder { <.2,.2,2.3> , <.2,.2,.2> , .2 } cylinder { <.2,.2,2.3> , <.2,.2,.2> , .2 } translate <-1,1.3,-4.3> } //end of rounded box union rotate x*15 translate <0,-4.5,-7.5> texture {Key_Texture} } #declare KEYS=union{ object { Key translate x*Bar_Distance*0 pigment {color BlueViolet} } object { Key translate x*Bar_Distance*1 pigment {color Blue} } object { Key translate x*Bar_Distance*2 pigment {color MediumForestGreen} } object { Key translate x*Bar_Distance*3 pigment {color Green} } object { Key translate x*Bar_Distance*4 pigment {color Yellow} } object { Key translate x*Bar_Distance*5 pigment {color Orange} } object { Key translate x*Bar_Distance*6 pigment {color Red} } object { Key translate x*Bar_Distance*7 pigment {color Pink} } } //end KEYS union // END Keys // BEGIN Strikers #declare Striker= union { cylinder { <0,0,0> , <0,1,0> , .5 texture {White_Plastic} } cylinder { <0,1,0> , <0,1.3,0> , .55 pigment {Gray30} } sphere { <0,0,0> , .5 scale <1,.45,1> translate y*1.3 texture {Chrome_Metal} } translate y*-2.1 } #declare STRIKERS=union{ object { Striker translate x*Bar_Distance*0 } object { Striker translate x*Bar_Distance*1 } object { Striker translate x*Bar_Distance*2 } object { Striker translate x*Bar_Distance*3 } object { Striker translate x*Bar_Distance*4 } object { Striker translate x*Bar_Distance*5 } object { Striker translate x*Bar_Distance*6 } object { Striker translate x*Bar_Distance*7 } } // END Strikers // BEGIN knobs #declare Knob= union { cylinder { <0,0,0> , <0,.9,0> , .38 texture {White_Plastic} } cylinder { <0,.9,0> , <0,1.15,0> , .55 texture {White_Plastic} } cylinder { <0,0,0> , <0,.2,0> , .85 pigment {color Gray80} } } #declare KNOBS=union{ union { object {Knob translate z*5.5/2 translate y*-.2} object {Knob translate z*-5.5/2 translate y*-.2} translate x*Bar_Distance*0 } union { object {Knob translate z*5.3/2 translate y*-.2} object {Knob translate z*-5.3/2 translate y*-.2} translate x*Bar_Distance*1 } union { object {Knob translate z*5.0/2 translate y*-.2} object {Knob translate z*-5.0/2 translate y*-.2} translate x*Bar_Distance*2 } union { object {Knob translate z*4.8/2 translate y*-.2} object {Knob translate z*-4.8/2 translate y*-.2} translate x*Bar_Distance*3 } union { object {Knob translate z*4.65/2 translate y*-.2} object {Knob translate z*-4.65/2 translate y*-.2} translate x*Bar_Distance*4 } union { object {Knob translate z*4.45/2 translate y*-.2} object {Knob translate z*-4.45/2 translate y*-.2} translate x*Bar_Distance*5 } union { object {Knob translate z*4.2/2 translate y*-.2} object {Knob translate z*-4.2/2 translate y*-.2} translate x*Bar_Distance*6 } union { object {Knob translate z*4.0/2 translate y*-.2} object {Knob translate z*-4.0/2 translate y*-.2} translate x*Bar_Distance*7 } } // end of KNOBS union // END Knobs // BEGIN bars #declare BARS=union{ difference { box { <-1.425,0,-9.8/2> , <1.425,.2,9.8/2> } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*5.5/2 } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*-5.5/2 } texture { Bar_Texture pigment {color BlueViolet} } } difference { box { <-1.425,0,-9.2/2> , <1.425,.2,9.2/2> } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*5.3/2 } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*-5.3/2 } translate x*Bar_Distance texture { Bar_Texture pigment {color Blue} } } difference { box { <-1.425,0,-8.7/2> , <1.425,.2,8.7/2> } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*5.0/2 } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*-5.0/2 } translate x*Bar_Distance*2 texture { Bar_Texture pigment {color MediumForestGreen} } } difference { box { <-1.425,0,-8.4/2> , <1.425,.2,8.4/2> } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*4.8/2 } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*-4.8/2 } translate x*Bar_Distance*3 texture { Bar_Texture pigment {color Green} } } difference { box { <-1.425,0,-7.9/2> , <1.425,.2,7.9/2> } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*4.65/2 } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*-4.65/2 } translate x*Bar_Distance*4 texture { Bar_Texture pigment {color Yellow} } } difference { box { <-1.425,0,-7.5/2> , <1.425,.2,7.5/2> } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*4.45/2 } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*-4.45/2 } translate x*Bar_Distance*5 texture { Bar_Texture pigment {color Orange} } } difference { box { <-1.425,0,-7.1/2> , <1.425,.2,7.1/2> } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*4.2/2 } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*-4.2/2 } translate x*Bar_Distance*6 texture { Bar_Texture pigment {color Red} } } difference { box { <-1.425,0,-6.8/2> , <1.425,.2,6.8/2> } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*4.0/2 } cylinder { <0,-1,0> , <0,1,0> , .5 translate z*-4.0/2 } translate x*Bar_Distance*7 texture { Bar_Texture pigment {color Pink} } } } //end of BARS union // END of Bars #declare TOY=union{ object {PLASTIC} object {STRIKERS} object {KNOBS} object {BARS} object {KEYS} object {Key_Plate} object {Blue_Part translate <-5.425,-9,-12> } } //end of TOY // // NOW PUT EVERYTHING IN THE SCENE! // // floor box { <0,-9.1,0> , <120,-9,60> translate <-15,0,-30> texture{ pigment {image_map{gif "cherryw2.gif" once interpolate 2 } rotate x*90 scale <120,1,60> translate <-15,0,-30> } finish {ambient .3} } texture{ pigment {color Clear} finish {phong .4 reflection .2} } } // wall plane { -z,-45 pigment {color NewTan} } // toy object { TOY rotate y*-35 } #declare Man_Texture1=texture { pigment {color MediumForestGreen} finish {phong .2} } #declare Man_Texture2=texture { pigment {color OrangeRed} finish {phong .2} } #declare TOY_MAN1= difference { union{ sphere { <0,0,0> , 1.05 pigment { image_map { gif "face.gif" interpolate 2 map_type 1}} finish { ambient .2 } rotate y*-90 translate y*4.305 } cylinder { <0,0,0> , <0,1,0> , 1 texture {Man_Texture1} } cylinder { <0,1,0> , <0,1.2,0> , 1.2 texture {Man_Texture1} } cylinder { <0,1.2,0> , <0,3.1,0> , 1.1 texture {Man_Texture1} } cone { <0,3.1,0> , 1.1 , <0,3.5,0> , 0 texture {Man_Texture1} } } cylinder { <0,-1,0> , <0,2.8,0> , .6 texture {Man_Texture1} } } // end of TOY_MAN1 #declare TOY_MAN2= difference { union{ sphere { <0,0,0> , 1.05 pigment { image_map { gif "face.gif" interpolate 2 map_type 1}} finish { ambient .2 } rotate y*-90 translate y*4.305 } cylinder { <0,0,0> , <0,1,0> , 1 texture {Man_Texture2} } cylinder { <0,1,0> , <0,1.2,0> , 1.2 texture {Man_Texture2} } cylinder { <0,1.2,0> , <0,3.1,0> , 1.1 texture {Man_Texture2} } cone { <0,3.1,0> , 1.1 , <0,3.5,0> , 0 texture {Man_Texture2} } } cylinder { <0,-1,0> , <0,2.8,0> , .6 texture {Man_Texture2} } } // end of TOY_MAN2 object {TOY_MAN1 translate <25,-9,-5> } object {TOY_MAN2 rotate y*45 rotate x*90 translate y*1.1 rotate y*45 translate <29,-9,-9> } camera { direction <0,0,2> location <12,17,-48> look_at <18,0,0> } light_source { <13,25,0> color Gray60} light_source { <-25,20,5> color White} light_source { <12,17,-48> color Gray60}