#declare bluetexture = texture { pigment { spotted pigment_map { [0 Blue *.3] [.4 Blue *.5] [.5 Blue *.6] [1 Blue *.6] } warp { turbulence .7 } } finish { ambient 0 specular .6 roughness .021 } normal { dents scale .2 bump_size .7 } }; #declare windowtexture = texture { pigment { Black } finish { ambient 0 specular .2 roughness .05 reflection { .1,.15 } } }; #declare machineGuntexture = texture { pigment { Gray15//Black } finish { ambient 0 specular .4 roughness .12 reflection { 0 , .1} metallic } normal { dents scale .1 } }; #declare flame = difference { sphere { <0,0,0>, 1 } box { <4,0,4>, <-4,-4,-4> } hollow scale <2,20,2> interior { media { intervals 5 //5 higher slows it up and gives smoother images samples 5 //5 lower = more blocky emission .6 //1 brightness of glowing media density { spherical scale <3,20,3> warp { turbulence <.8,.07,.05> } density_map { [0 rgb 0] [.5 rgb 0] [.6 rgb Orange] [.7 color Yellow] [.8 color Yellow] [.9 color White] [1 color White] } } } } texture { pigment { Clear } } }; #macro roundedPyramid(sizeTop,sizeBottom,height, curveSize) union { // top front corners sphere { <(sizeTop/2)*-1,height/2,(sizeTop/2)*-1>,curveSize } sphere { <(sizeTop/2),height/2,(sizeTop/2)*-1>,curveSize } // top back corners sphere { <(sizeTop/2)*-1,height/2,(sizeTop/2)>,curveSize } sphere { <(sizeTop/2),height/2,(sizeTop/2)>,curveSize } // bottom front corners sphere { <(sizeBottom/2)*-1,(height/2)*-1,(sizeBottom/2)*-1>,curveSize } sphere { <(sizeBottom/2),(height/2)*-1,(sizeBottom/2)*-1>,curveSize } // top back corners sphere { <(sizeBottom/2)*-1,(height/2)*-1,(sizeBottom/2)>,curveSize } sphere { <(sizeBottom/2),(height/2)*-1,(sizeBottom/2)>,curveSize } // top front cylinder cylinder{ <(sizeTop/2)*-1,height/2,(sizeTop/2)*-1>, <(sizeTop/2),height/2,(sizeTop/2)*-1>, curveSize } // top left cylinder cylinder{ <(sizeTop/2)*-1,height/2,(sizeTop/2)*-1>, <(sizeTop/2)*-1,(height/2),(sizeTop/2)>, curveSize } // top back cylinder cylinder{ <(sizeTop/2)*-1,height/2,(sizeTop/2)>, <(sizeTop/2),height/2,(sizeTop/2)>, curveSize } // top right cylinder cylinder{ <(sizeTop/2),height/2,(sizeTop/2)*-1>, <(sizeTop/2),(height/2),(sizeTop/2)>, curveSize } // bottom front cylinder cylinder{ <(sizeBottom/2)*-1,(height/2)*-1,(sizeBottom/2)*-1>, <(sizeBottom/2),(height/2)*-1,(sizeBottom/2)*-1>, curveSize } // bottom left cylinder cylinder{ <(sizeBottom/2)*-1,(height/2)*-1,(sizeBottom/2)*-1>, <(sizeBottom/2)*-1,(height/2)*-1,(sizeBottom/2)>, curveSize } // bottom back cylinder cylinder{ <(sizeBottom/2)*-1,(height/2)*-1,(sizeBottom/2)>, <(sizeBottom/2),(height/2)*-1,(sizeBottom/2)>, curveSize } // bottom right cylinder cylinder{ <(sizeBottom/2),(height/2)*-1,(sizeBottom/2)*-1>, <(sizeBottom/2),(height/2)*-1,(sizeBottom/2)>, curveSize } // near verticals // front left cylinder{ <(sizeTop/2)*-1,height/2,(sizeTop/2)*-1>, <(sizeBottom/2)*-1,(height/2)*-1,(sizeBottom/2)*-1>, curveSize } // front right cylinder{ <(sizeTop/2),height/2,(sizeTop/2)*-1>, <(sizeBottom/2),(height/2)*-1,(sizeBottom/2)*-1>, curveSize } // back left cylinder{ <(sizeTop/2)*-1,height/2,(sizeTop/2)>, <(sizeBottom/2)*-1,(height/2)*-1,(sizeBottom/2)>, curveSize } // back right cylinder{ <(sizeTop/2),height/2,(sizeTop/2)>, <(sizeBottom/2),(height/2)*-1,(sizeBottom/2)>, curveSize } // sides face union { triangle{ <(sizeTop/2)*-1,height/2,((sizeTop/2)*-1)-curveSize>, <(sizeTop/2),height/2,((sizeTop/2)*-1)-curveSize>, <(sizeBottom/2)*-1,(height/2)*-1,((sizeBottom/2)*-1)-curveSize> } triangle{ <(sizeBottom/2)*-1,(height/2)*-1,((sizeBottom/2)*-1)-curveSize>, <(sizeBottom/2),(height/2)*-1,((sizeBottom/2)*-1)-curveSize>, <(sizeTop/2),height/2,((sizeTop/2)*-1)-curveSize> } } union { triangle{ <(sizeTop/2)*-1,height/2,((sizeTop/2)*-1)-curveSize>, <(sizeTop/2),height/2,((sizeTop/2)*-1)-curveSize>, <(sizeBottom/2)*-1,(height/2)*-1,((sizeBottom/2)*-1)-curveSize> } triangle{ <(sizeBottom/2)*-1,(height/2)*-1,((sizeBottom/2)*-1)-curveSize>, <(sizeBottom/2),(height/2)*-1,((sizeBottom/2)*-1)-curveSize>, <(sizeTop/2),height/2,((sizeTop/2)*-1)-curveSize> } rotate <0,90,0> } union { triangle{ <(sizeTop/2)*-1,height/2,((sizeTop/2)*-1)-curveSize>, <(sizeTop/2),height/2,((sizeTop/2)*-1)-curveSize>, <(sizeBottom/2)*-1,(height/2)*-1,((sizeBottom/2)*-1)-curveSize> } triangle{ <(sizeBottom/2)*-1,(height/2)*-1,((sizeBottom/2)*-1)-curveSize>, <(sizeBottom/2),(height/2)*-1,((sizeBottom/2)*-1)-curveSize>, <(sizeTop/2),height/2,((sizeTop/2)*-1)-curveSize> } rotate <0,-90,0> } union { triangle{ <(sizeTop/2)*-1,height/2,((sizeTop/2)*-1)-curveSize>, <(sizeTop/2),height/2,((sizeTop/2)*-1)-curveSize>, <(sizeBottom/2)*-1,(height/2)*-1,((sizeBottom/2)*-1)-curveSize> } triangle{ <(sizeBottom/2)*-1,(height/2)*-1,((sizeBottom/2)*-1)-curveSize>, <(sizeBottom/2),(height/2)*-1,((sizeBottom/2)*-1)-curveSize>, <(sizeTop/2),height/2,((sizeTop/2)*-1)-curveSize> } rotate <0,180,0> } // top surface union { triangle{ <(sizeTop/2)*-1,(height/2)+curveSize,((sizeTop/2)*-1)>, <(sizeTop/2),(height/2)+curveSize,((sizeTop/2)*-1)>, <(sizeTop/2),(height/2)+curveSize,(sizeTop/2)> } triangle{ <(sizeTop/2)*-1,(height/2)+curveSize,sizeTop/2>, <(sizeTop/2),(height/2)+curveSize,sizeTop/2>, <(sizeTop/2)*-1,(height/2)+curveSize,(sizeTop/2)*-1> } } // bottom surface union { triangle{ <(sizeBottom/2)*-1,((height/2)+curveSize)*-1,((sizeBottom/2)*-1)>, <(sizeBottom/2),((height/2)+curveSize)*-1,((sizeBottom/2)*-1)>, <(sizeBottom/2),((height/2)+curveSize)*-1,(sizeBottom/2)> } triangle{ <(sizeBottom/2)*-1,((height/2)+curveSize)*-1,sizeBottom/2>, <(sizeBottom/2),((height/2)+curveSize)*-1,sizeBottom/2>, <(sizeBottom/2)*-1,((height/2)+curveSize)*-1,(sizeBottom/2)*-1> } } } #end #declare mainBodySphere = sphere { <0,0,0>,10 scale <1,1,2> }; #declare window = intersection { object { mainBodySphere } box { <-2,3,-20>, <2,5,0> } texture { windowtexture } }; #macro machineGun(rotat,firing) #declare rotat = ; union { union { sphere { <0,0,0>,.6 } cylinder{ <0,0,0>, <0,0,-3>, .4 } cylinder{ <0,0,0>, <0,0,-4>, .35 } cylinder{ <0,0,-3.5>, <0,0,-4.5>, .4 } rotate rotat } cylinder{ <0,0,.1>, <0,0,-.1>, 1 } texture { machineGuntexture } } #end #declare mainBodyVent = union { difference { superellipsoid { <.02,.02> scale <3,7,10.1> } box { <-2.3,6.5,-12>, <2.3,-6.5,0> } } #declare t1 = 6.3; #while(t1 > -6.3) box { <-2.3,0,0> <2.3,.05,1> rotate <30,0,0> translate <0,t1,-10> } #declare t1 = t1 - .4; #end }; #declare overBodyArch = prism { linear_sweep linear_spline 0, // sweep the following shape from here ... 10, // ... up through here 7, // the number of points making up the shape ... <-16.7 ,0>, <16.7 ,0>, <16.7 ,8>, <9 ,14>, <-9 ,14>, <-16.7 ,8>, <-16.7 ,0> } #declare missileBox = difference { union { box { <-5,5,0>, <5,-5,7> } cylinder{ <-5,4.5,0>, <-5,4.5,7>, .5 } cylinder{ <-5,-4.5,0>, <-5,-4.5,7>, .5 } cylinder{ <5,4.5,0>, <5,4.5,7>, .5 } cylinder{ <5,-4.5,0>, <5,-4.5,7>, .5 } box { <-5.5,4.5,0>, <5.5,-4.5,7> } // a wee bit of greeblage superellipsoid { <.2,.1> scale <2,.2,1> translate <-3,5,3> } superellipsoid { <.2,.1> scale <2,.2,1.1> rotate <0,90,0> translate <3.5,5,3> } superellipsoid {<.2,.1> scale <2.5,.2,.4> rotate <0,0,90> translate <5.5,0,2.2> } superellipsoid {<.2,.1> scale <2.5,.2,.4> rotate <0,0,90> translate <5.5,0,3.4> } superellipsoid {<.2,.1> scale <2.5,.2,.4> rotate <0,0,90> translate <5.5,0,4.4> } } // 1st row cylinder{<4.5,4.1,-1>, <4.5,4.1,5> ,.6} cylinder{<3,4.1,-1>, <3,4.1,5> ,.6} cylinder{<1.5,4.1,-1>, <1.5,4.1,5> ,.6} cylinder{<0,4.1,-1>, <0,4.1,5> ,.6} cylinder{<-1.5,4.1,-1>, <-1.5,4.1,5> ,.6} cylinder{<-3,4.1,-1>, <-3,4.1,5> ,.6} cylinder{<-4.5,4.1,-1>, <-4.5,4.1,5> ,.6} //2nd row cylinder{<3.8,2.8,-1>, <3.8,2.8,5> ,.6} cylinder{<2.3,2.8,-1>, <2.3,2.8,5> ,.6} cylinder{<.8,2.8,-1>, <.8,2.8,5> ,.6} // 3rd row cylinder{<4.5,1.5,-1>, <4.5,1.5,5> ,.6} cylinder{<3,1.5,-1>, <3,1.5,5> ,.6} //4th row cylinder{<3.8,.3,-1>, <3.8,.3,5> ,.6} }; // weapontype 1 = autocannon, 2 = box thing #macro weapon(weapontype , firing) union { box { <-1.7,-1,-2.8>, <1.7,-4.8,3.8> } #if(weapontype = 2) difference { box { <-3,-3.8,-3>, <3,-12,3> } cylinder{ <0,-4.,0>, <0,-13,0>, .9 } cylinder{ <1.8,-4.,-1.8>, <1.8,-13,-1.8>, .9 } cylinder{ <-1.8,-4.,-1.8>, <-1.8,-13,-1.8>, .9 } cylinder{ <1.8,-4.,1.8>, <1.8,-13,1.8>, .9 } cylinder{ <-1.8,-4.,1.8>, <-1.8,-13,1.8>, .9 } scale 1.5 translate <0,0,3> } #end #if(weapontype = 1) box { <-3,-3.8,-3>, <3,-10,3> } box { <-2,-10,-2>, <2,-11,2> } box { <-1.5,-11,-1.5>, <1.5,-12,1.5> } superellipsoid { <.2,.2> scale <1,2,.3> translate <0,-7,-3.2> } cylinder{ <0,-5,0>, <0,-8,0>, 4 translate <0,0,3> } difference { cylinder{ <0,-11,-1>, <0,-15,-1>, 1 } cylinder{ <0,-11,-1>, <0,-16,-1>, .7 } } object { flame rotate <180,0,0> translate <0,-15,-1> } #end texture { machineGuntexture } } #end #macro lowerarm(elbowrotat, weapontype , firing) union { cylinder { <-3,0,0>, <3,0,0>, 2.8 } sphere { <0,0,0>, 2.8 scale <.2,1,1> translate <3,0,0> } sphere { <0,0,0>, 2.8 scale <.2,1,1> translate <-3,0,0> } cylinder{ <-.2,0,0>, <.2,0,0>, 3.7 translate <-1.8,0,0> } cylinder{ <-.2,0,0>, <.2,0,0>, 3.7 translate <1.8,0,0> } object { weapon(weapontype , firing) } rotate <50,0,0> rotate elbowrotat } #end #macro arm(shoulderrotat , elbowrotat , weapontype , firing) union { cylinder{ <-2.2,0,0>, <2.2,0,0>, 5 } cylinder{ <-2.6,0,0>, <2.6,0,0>, 4.2 } cylinder{ <-3,0,0>, <3,0,0>, 3 } difference { box { <-2.2,0,-5>, <2.2 ,-8.5,5> } cylinder{ <0,0,-6>, <0,0,6>, 1.5 scale <.7,2,1> translate <-2.2,-8,0> } cylinder{ <0,0,-6>, <0,0,6>, 1.5 scale <.7,2,1> translate <2.2,-8,0> } cylinder{ <-3,0,0>, <3,0,0>, 1.5 scale <1,2,1> translate <0,-8,-4.8> } } object { lowerarm(elbowrotat, weapontype , firing) translate <0,-9,0> } rotate <40,0,0> rotate shoulderrotat } #end #macro upperBody(mainBodySwivel, rightshoulderrotat, rightelbowrotat, rightweapontype,rightfiring, leftshoulderrotat, leftelbowrotat, leftweapontype, leftfiring ) union { // robots-right arm object { arm(rightshoulderrotat,rightelbowrotat, rightweapontype,rightfiring) translate <-20,0,0> } // robots-left arm object { arm(leftshoulderrotat, leftelbowrotat, leftweapontype, leftfiring) translate <20,0,0> } // the missile unit object { missileBox scale 1.5 translate <10,10.5,5> } //main body arch difference { object { overBodyArch rotate <-90,0,0> translate <0,0,4> } object { overBodyArch scale <.9, .8, .9> rotate <-90,0,0> translate <0,0,-4> } } //inner arm cross bocy cylinder cylinder{ <-18,0,0>, <18,0,0>, 4 } //main arm cross bocy cylinder cylinder{ <-17,0,0>, <17,0,0>, 5 } // left mainbodyvent object { mainBodyVent scale <.8,1,1> translate <-11.2,-3,0> } //right main body vent object { mainBodyVent scale <.8,1,1> translate <11.2,-3,0> } //machine gun mount superellipsoid { <.03,.03> scale <2,2,7> translate <0,-9,-5> } // first cylinderof body swivel point cylinder{ <0,0,0>, <0,-10.5,0>, 7 } // second cylinderof body swivel point cylinder{ <0,0,0>, <0,-11.5,0>, 6 } // main box of body superellipsoid { <.02,.02> scale <10.1,10,10.1> translate <0,0,5> } difference { object { mainBodySphere } // window cut out box { <-2,3,-20>, <2,5,0> } //vents cone { <-7,3,-20>,.4, <-7,3,0>,.2 scale <1,1.1,1> } cone { <7,3,-20>,.4, <7,3,0>,.2 scale <1,1.1,1> } cone { <-7,-3,-20>,.4, <-7,-3,0>,.2 scale <1,1.1,1> } cone { <7,-3,-20>,.4, <7,-3,0>,.2 scale <1,1.1,1> } //back end of sphere cut off box { <10,10,20>, <-10,-10,3> } } object { window translate <0,0,.1> } //machine gun object { machineGun(<0,0,0>,false) translate <0,-9.5,-12.1> } texture { bluetexture } //this translate move the swivel to the 0,0,0 position translate <0,11.5,0> rotate mainBodySwivel } #end #macro foot(anklerotat) union { object { //roundedPyramid(sizeTop,sizeBottom,height, curveSize) roundedPyramid(7,10,6,.5) translate <0,-2,0> } object { roundedPyramid(10,10.5,.5,.2) translate <0,-6,-.2> } scale <1,.9,1.2> rotate <-30,0,0> rotate anklerotat } #end #macro shin(kneerotat,anklerotat) union { box { <-3,0,-2>, <3,-10,2> } sphere { <0,0,0>, 6 scale <1,.5,.7> translate <0,-8,0> } cone { <0,0,0>,6, <0,-14,0>,5 scale <1,1,.7> translate <0,-8,0> } sphere { <0,0,0>, 5 scale <1,.5,.7> translate <0,-22,0> } box { <-2,-20,-2>, <2,-28,2> } cylinder{ <-2,-28,0>, <2,-28,0>, 2 } object { foot(anklerotat) translate <0,-27,0> } rotate <80,0,0> rotate kneerotat } #end #macro leg(hiprotat,kneerotat,anklerotat) union { cylinder{ <5,0,0>, <-5,0,0>, 5.5 } cylinder{ <5.5,0,0>, <-5.5,0,0>, 5 } cylinder{ <6,0,0>, <-6,0,0>, 3.5 } // And before you ask, yes, these are hand-cranked triangles // front of leg triangle{ <-5,0,-5.5>, <5, 0,-5.5>, <5,-15,-4.5> } triangle{ <-5,0,-5.5>, <-5,-15,-4.5>, <5,-15,-4.5> } // back of leg triangle{ <-5,0,5.5>, <5, 0,5.5>, <5,-15,4.5> } triangle{ <-5,0,5.5>, <-5,-15,4.5>, <5,-15,4.5> } // right of leg triangle{ <5, 0,5.5>, <5,0,-5.5>, <5,-15,-4.5> } triangle{ <5, 0,5.5>, <5,-15,4.5>, <5,-15,-4.5> } // left of leg triangle{ <-5, 0,5.5>, <-5,0,-5.5>, <-5,-15,-4.5> } triangle{ <-5, 0,5.5>, <-5,-15,4.5>, <-5,-15,-4.5> } cylinder{ <5,0,0>, <-5,0,0>, 4.5 translate <0,-15,0> } cylinder{ <5.5,0,0>, <-5.5,0,0>, 4 translate <0,-15,0> } cylinder{ <6,0,0>, <-6,0,0>, 3.5 translate <0,-15,0> } object { shin(kneerotat,anklerotat) translate <0,-15,0> } rotate <-50,0,0> rotate hiprotat } #end #macro blueMech(mainBodySwivel, rightshoulderrotat, rightelbowrotat, rightweapontype,rightfiring, leftshoulderrotat, leftelbowrotat, leftweapontype, leftfiring righthiprotat,rightkneerotat,rightanklerotat, lefthiprotat,leftkneerotat,leftanklerotat ) union { object { upperBody(mainBodySwivel, rightshoulderrotat, rightelbowrotat, rightweapontype,rightfiring, leftshoulderrotat, leftelbowrotat, leftweapontype, leftfiring ) } // robot groin union { difference { superellipsoid { <.1,.03> scale <6,5,6> } #declare t1 = -5; #while(t1 < 5) box { <-.15,2,-7>, <.15,-1,0> translate } #declare t1 = t1 + .7; #end translate <0,-5,0> } cylinder{ <-5,-15,-6>, <-5,-15,6> .5 } cylinder{ <5,-15,-6>, <5,-15,6> .5 } difference { box { <-5.5,-15,-6>, <5.5,-10,6> } box { <-3.5,3.5,-7>, <3.5,-3.5,7> rotate <0,0,45> translate <0,-15.9,0> } } cylinder{ <-7,0,0>, <7,0,0>, 5 translate <0,-6,0> } cylinder{ <-8,0,0>, <8,0,0>, 4.5 translate <0,-6,0> } object { leg(righthiprotat,rightkneerotat,rightanklerotat) translate <13,-6,0> } object { leg(lefthiprotat,leftkneerotat,leftanklerotat) translate <-13,-6,0> } texture { bluetexture } } } #end