#include "colors.inc" #include "metals.inc" #include "finish.inc" /* Automobile "VW bug-like" x: -.9 to .9 units width y: 0 to 1.5 units height z: -2 to 1.2 units initial facing -z direction mrg3@psu.edu */ global_settings { max_trace_level 10 } #declare bugbody = intersection{ union{ intersection{ sphere{<0,-.28,-.02>,1.25} box { <-.65, 0, 0>, <.65, 1, -1.15> } scale <1,.8,1.0> translate -.8*z } difference{ intersection{ sphere{<0,0,0>,1.2} box { <-.8, -0, 1.25>, <.8, 1.2, -1.3> } //box { <-.65, -0, 1.25>, <.65, 1.2, -1.3> } } box { <-.62, 0, 0>, <.62, 2, -2> rotate 30*x translate <0,.6,-.8>} } } sphere{<0,0,0>,.65 scale <1,3,10>} } #declare windshield = intersection{ intersection{ sphere{<0,0,0>,1.2} box { <-.62, 0, 0>, <.62, 2, -.01> rotate 30*x translate <0,.6,-.8>} scale <1.0,1.0,1.0> } box { <-.55, -0, 1.15>, <.55, 1.2, -1.3> } } #declare lsidewindow = intersection{ object{bugbody} object{bugbody translate -.01*y+.01*x} box{<.50,.5,-.8>,<.6,1.2,.7> rotate -z*.5} scale <1,.8,.9> translate .005*x+.18*y } #declare rsidewindow = object{lsidewindow scale <-1,1,1>} #declare rearwindow = intersection{ difference{ object{bugbody translate +.01*z+.01*y} object{bugbody}} box{<-.450,.65,0>,<.45,.95,2> //translate z*.07 } } #declare allwindows = union{ object{windshield} object{lsidewindow} object{rsidewindow} object{rearwindow} texture{ pigment{ color Grey } finish { F_MetalA }} texture{ pigment{color rgbf <.1,.6,.6,.9>}} } #declare fender = difference{ intersection{ sphere{<0,0,0>,.45} box { <-.1, 0, .9>, <.2, 1, -.9> } } cone { <0, 0, 0>, 0.4, <.6, 0, 0>, .3 }} #declare wheel = union{ cylinder { <-.05, 0, 0>, <.20, 0, 0>, .30 pigment{ color Black }} intersection{ sphere{<-.05,0,0>,.3} box { <.0, -.3, -.3>, <.3, .3, .3> } pigment{ color P_Silver1 } finish { F_MetalA }} } #declare headlight = union{ difference{ cylinder { <0, 0, 0>, <0, 0, -.15>, .09 } cylinder{ <-.3,-.5,.5>, <.3,-.5,.5> .7 } pigment{ color <.9,.0,.0> } finish { Shiny}} cylinder { <0, 0, -.15>, <0, 0, -.17>, .085 pigment{ color White } finish { Shiny}} } #declare automobile_bug = union{ object{bugbody pigment{ color <.9,.0,.0> } finish { Shiny} } object{allwindows } object{fender pigment{ color <.9,.0,.0> } finish { Shiny} translate x*.65-z*1.35 } object{fender pigment{ color <.9,.0,.0> } finish { Shiny} translate x*.65+z*.6 } object{fender pigment{ color <.9,.0,.0> } finish { Shiny} scale <-1,1,1> translate -x*.65-z*1.35 } object{fender pigment{ color <.9,.0,.0> } finish { Shiny} scale <-1,1,1> translate -x*.65+z*.6 } object{wheel translate x*.6-z*1.35 } object{wheel translate x*.6+z*.6 } object{wheel scale <-1,1,1> translate -x*.6-z*1.35 } object{wheel scale <-1,1,1> translate -x*.6+z*.6 } object{headlight translate x*.75-z*1.6+y*.26} object{headlight translate -x*.75-z*1.6+y*.26} translate y*.3 }