#version Unofficial MegaPov 0.6; #include "colors.inc" #include "textures.inc" #declare UsePhotons=yes; global_settings { max_trace_level 10 #if(UsePhotons) photons { count 50000 autostop 0 media 450 } #end } light_source { <0,19,0> color rgb .6 // light's color fade_distance 30 fade_power 2 area_light x,z 4,4 adaptive 2 jitter orient media_interaction off media_attenuation off photons{ reflection off refraction off} } light_source { <15,19,0> color rgb .6 // light's color fade_distance 30 fade_power 2 area_light x,z 4,4 adaptive 2 jitter orient media_interaction off media_attenuation off photons{ reflection off refraction off} } camera { location <8,9,27> up <0,1,0> right <-4/3,0,0> rotate 0*y //angle 60 look_at <0,1,5> } //media box box { <-40,-1,-80> <40,30,40> hollow pigment { rgbt 1 } photons { pass_through } interior { media { samples 10,10 intervals 5 scattering { 1, rgb .5 extinction .001 } method 2 } } } //room box { <20,20,50> <-20,0,-20> inverse hollow texture {pigment {rgb <.6,.6,.6>} finish { ambient 0 diffuse 0.6 reflection 0.001 phong .1 phong_size 100} } } #macro mirror (tilt) #local tilt = -tilt; //tilt of the mirror in degrees #local holdertex = texture{ pigment { granite scale 5} finish { ambient 0.1 diffuse 0.8 reflection 0.1 phong 1 phong_size 200} normal { bumps scale 0.05}} #local holder= union{ //holder stand union{ cylinder { <0,.3,0> <0,1,0> 0.06 } //legs union{ cylinder { <0,.3,0> <2,-1,0> 0.05} cylinder { <.425,0,0> <.425,.03,0> .15} cylinder { <0,.3,0> <2,-1,0> 0.05 rotate <0,120,0>} cylinder { <.425,0,0> <.425,.03,0> .15 rotate <0,120,0>} cylinder { <0,.3,0> <2,-1,0> 0.05 rotate <0,240,0>} cylinder { <.425,0,0> <.425,.03,0> .15 rotate <0,240,0>} } texture {holdertex} } difference{ //ring on top of holder stand cylinder { <0,1.5,0.05> <0,1.5,-.05> .5} cylinder { <0,1.5,1> <0,1.5,-1> .45} texture {holdertex} } union { //mirror screws cylinder { <.505,1.5,0> <.38,1.5,0> 0.03} cylinder { <-.51,1.5,0> <-.38,1.5,0> 0.03} cylinder { <-.505,1.5,0> <-.55,1.5,0> .12} cylinder { <0.505,1.5,0> <0.55,1.5,0> .12} texture{ pigment { color rgb <.5,.5,.5>} finish { ambient 0.1 diffuse 0.8 phong 1 phong_size 200} } } clipped_by {plane {-y,0} }} //mirror #local mirror1= union{ difference{ cylinder { <0,1.5,0.05> <0,1.5,-0.05> 0.40} cylinder { <0,1.5,1> <0,1.5,-1> 0.375} texture{holdertex}} cylinder { <0,1.5,0.03> <0,1.5,-.03> .38 pigment { rgb <0,0,0> } finish { reflection 1.0 diffuse 0 ambient .5 } #if(UsePhotons) photons { target 1 refraction off reflection on ignore_photons } #end } translate <0,-1.5,0> rotate translate <0,1.5,0> } #declare Mirror = union { object {mirror1} object {holder} } object {Mirror} #end #macro gun(laser_color) #declare body = union{ difference { intersection{ box { <-1.5,0,-.75> <1.5,1,.75>} plane {-x,.7 rotate 30*z}} box {<2,.05,-.7> <1.3,.95,.7>} //rear cutout intersection{ //front cutout box { <-1.5,0,-.75> <1.5,1,.75> } plane {-x,.7 rotate -30*z} scale 0.9*<-1,1,1> translate <-1.25,.05,0>} cylinder { <1.25,.5,0> <-4,.5,0> .15 } } cylinder { <0,0,0> <0,-.3,0> .4} cylinder { <0,-.3,0> <0,-.6,0> .3} cylinder { <0,-.6,0> <0,-1,0> .55}} #declare heat_sinks = union{ box { <0,.3,.025> <.3,.8,-.025> translate <1.25,0,0>}//heat sink box { <0,.3,.025> <.3,.8,-.025> translate <1.25,0,.1>}//heat sink box { <0,.3,.025> <.3,.8,-.025> translate <1.25,0,.2>}//heat sink box { <0,.3,.025> <.3,.8,-.025> translate <1.25,0,.3>}//heat sink box { <0,.3,.025> <.3,.8,-.025> translate <1.25,0,.4>}//heat sink box { <0,.3,.025> <.3,.8,-.025> translate <1.25,0,.5>}//heat sink box { <0,.3,.025> <.3,.8,-.025> translate <1.25,0,.6>}//heat sink } #declare light = union{ cylinder { <1.3,.5,-.3> <1.35,.5,-.3> .15 pigment {color Silver}} union{ light_source { <1.4,.5,-.3> rgb .25 fade_distance 5 fade_power 3 media_interaction off} intersection{ difference { sphere { <0,.5,-.3> .1 } sphere { <0,.5,-.3> .09 } interior {ior 1.3 caustics 2}pigment {rgbf <.6,.6,1,0.999>} finish {ambient 0.5 diffuse .8 reflection 0.1 phong 1 phong_size 200}} plane {-x,0} translate <1.35,0,0>}}} #declare antenna = union{ sphere {< 0,0,0> .5 scale <1.5,.5,1>} cylinder {<.5,0,0> <.5,3,0>.03} cylinder {<.4,0,-.1> <.4,2,-.1>.03} clipped_by {plane {-y,0}} translate <.4,.99,-.25>} #declare barrel= difference{ union{ cylinder { <1,.5,0> <-1.5,.5,0> .3 } cone {<-1.5,.5,0> .3 <-2.3,.5,0> .2 } cylinder { <-2.0,.5,0> <-3.2,.5,0> .2 } //object {boot scale <.8,1,.8> rotate 90*z translate <-0.7,.5,0>} } cylinder { <4,.5,0> <-4,.5,0> .15 } } #declare barreltex = texture { pigment {color rgb <.4,.4,.4>} finish { ambient 0.1 diffuse 0.6 reflection .1 phong 1 phong_size 250}} #declare bodytex = texture { Aluminum normal {dents .8 scale 0.4}} #declare heatsinktex = texture { pigment {color rgb<.3,.3,.3>} finish { ambient 0.1 diffuse 0.6 reflection .025 phong 1 phong_size 250}} #declare antex = texture { pigment {color rgb<.3,.3,.3>} finish { ambient 0.1 diffuse 0.6 reflection .025 phong 1 phong_size 250}} #declare turret = union{ light_source { <-1,.5,0> // light's position (translated below) color laser_color // light's color spotlight // this kind of light source point_at <-20,.5,0> // direction of spotlight radius .3 falloff .75 // hotspot (inner, in degrees) tightness 75 // tightness of falloff (1...100) lower is softer, higher is tighter media_interaction on media_attenuation off photons{ refraction off reflection on} // intensity falloff radius (outer, in degrees) } object {body texture {bodytex}} object {heat_sinks texture {heatsinktex}} object {light} object {barrel texture {barreltex}} object {antenna texture {antex}} translate <0,1,0>} object{turret} #end object {gun(rgb <2,0,0>) rotate -90*y translate <-5,0,15>} object {gun(rgb <0,2,2>) rotate -90*y translate <5,0,15>} //Red Mirror object {mirror(0) rotate 45*y translate <-5,0,-5>} object {mirror(0) rotate -45*y translate <0,0,-5>} object {mirror(0) rotate 135*y translate <0,0,5>} object {mirror(40) rotate -90*y translate <10,0,5>} //Blue mirrors object {mirror(0) rotate -45*y translate <5,0,-7>} object {mirror(0) rotate 45*y translate <2,0,-7>} object {mirror(-0) rotate -135*y translate <2,0,3>} object {mirror(45) rotate 90*y translate <-8,0,3>}