// To Use : // Include this file in your scene with the "#include" statement // Call the raiderMech macro, example below. // The parameters are as follows // raiderMech(TorsoRot, LeftArmRot, RightArmRot, LeftHipRot, LeftKneeRot, LeftFootRot , RightHipRot, RightKneeRot, RightFootRot) // Example call... // raiderMech(<0,0,0>, <0,0,0>, <0,0,0>, <0,0,0>, <0,0,0>, <0,0,0> , <0,0,0>, <0,0,0>, <0,0,0>) #declare rxTexture = texture { pigment { bozo scale 2 warp { turbulence 1.2 } pigment_map { [0 DarkBrown] [.53 DarkBrown] [.66 Yellow *.2] } } finish { ambient 0 specular .1 } normal { dents warp { turbulence .2 } } }; #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 #macro tubeEndedBox(xx,yy,zz,d) union { box { <(xx/2)*-1,(yy/2)*-1,(zz/2)*-1>, <(xx/2) ,(yy/2) ,(zz/2)> } cylinder{ <(xx/2)*-1,(yy/2)*-1,(zz/2)*-1>, <(xx/2)*-1,(yy/2),(zz/2)*-1>, d } cylinder{ <(xx/2),(yy/2)*-1,(zz/2)*-1>, <(xx/2),(yy/2),(zz/2)*-1>, d } cylinder{ <(xx/2)*-1,(yy/2)*-1,(zz/2)*-1>, <(xx/2),(yy/2)*-1,(zz/2)*-1>, d } cylinder{ <(xx/2)*-1,(yy/2),(zz/2)*-1>, <(xx/2),(yy/2),(zz/2)*-1>, d } sphere { <(xx/2)*-1,(yy/2),(zz/2)*-1>,d } sphere { <(xx/2)*-1,(yy/2)*-1,(zz/2)*-1>,d } sphere { <(xx/2),(yy/2),(zz/2)*-1>,d } sphere { <(xx/2),(yy/2)*-1,(zz/2)*-1>,d } cylinder{ <(xx/2)*-1,(yy/2)*-1,(zz/2)>, <(xx/2)*-1,(yy/2),(zz/2)>, d } cylinder{ <(xx/2),(yy/2)*-1,(zz/2)>, <(xx/2),(yy/2),(zz/2)>, d } cylinder{ <(xx/2)*-1,(yy/2)*-1,(zz/2)>, <(xx/2),(yy/2)*-1,(zz/2)>, d } cylinder{ <(xx/2)*-1,(yy/2),(zz/2)>, <(xx/2),(yy/2),(zz/2)>, d } sphere { <(xx/2)*-1,(yy/2),(zz/2)>,d } sphere { <(xx/2)*-1,(yy/2)*-1,(zz/2)>,d } sphere { <(xx/2),(yy/2),(zz/2)>,d } sphere { <(xx/2),(yy/2)*-1,(zz/2)>,d } } #end #macro roundedCylinder(length,theSize) union { cylinder { <0,length/2,0>, <0,(length/2)*-1,0>, theSize } sphere { <0,length/2,0>, theSize } sphere { <0,(length/2)*-1,0>, theSize } } #end #declare rxChestSegment = union { object { tubeEndedBox(7,4,20,.3) //translate <10,0,0> } object { roundedCylinder(7,1) rotate <0,0,90> scale <1,5.7,10.5> bounded_by { box {<10,10,10>,<-10,-10,-10.2>}} clipped_by { bounded_by } } }; #macro rxBarrel() union { cylinder{ <0,0,0>, <0,-25,0>, .5 } cylinder{ <0,0,0>, <0,-15,0>, .8 } cylinder{ <0,-14,0>, <0,-14.5,0>, .9 } cylinder{ <0,-13,0>, <0,-13.5,0>, .9 } cylinder{ <0,-11,0>, <0,-12.5,0>, .9 } union { cone { <0,-24,0>,.5, <0,-26,0>,.95 } cylinder{ <0,-26,0>, <0,-27,0> .95 } difference { cone { <0,-27,0>,.95, <0,-28,0>,.6 } cylinder{ <0,-26,0>, <0,-29,0> .4 } } } } #end #macro rxArm() union { union { object { roundedPyramid(4,4,14, .5) } object { roundedPyramid(4,3,4,.5) translate <0,-9,0> } scale <1,1,.75> } object { rxBarrel() translate <-1,0,0> } object { rxBarrel() translate <1,0,0> } object { roundedPyramid(2,2.7,2, .2) rotate <-90,0,0> scale <0,5,0> translate <0,2,-2> } object { roundedPyramid(2,2.7,2, .2) rotate <90,0,0> scale <0,5,0> translate <0,2,2> } union { cylinder{ <-3,0,0> <3,0,0>, 2 } cone { <3,0,0>,2, <3.3,0,0>,1.5 } sphere { <0,0,0>,1.5 scale <.2,1,1> translate <3.3,0,0> } cone { <-3,0,0>,2, <-3.3,0,0>,1.5 } sphere { <0,0,0>,1.5 scale <.2,1,1> translate <-3.3,0,0> } translate <0,4,0> } translate <0,-4,0> } #end #macro rxUpperTorso(LeftArmRot,RightArmRot) union { object { rxArm() scale 1.3 translate <-17,0,0> rotate LeftArmRot } object { rxArm() scale 1.3 translate <17,0,0> rotate RightArmRot } union { prism { linear_sweep 0,5,9, <-12,3>, <-12,-3>, <-5,-7>, <5,-7>, <12,-3>, <12,3>, <5,7>, <-5,7>, <-12,3> } prism { conic_sweep 0,.5,8, <-12,3>, <-12,-3>, <-5,-7>, <5,-7>, <12,-3>, <12,3>, <5,7>, <-5,7>//, //<-12,5> scale <2,8,2> rotate <180,0,0> translate <0,9,0> } prism { conic_sweep 0,.5,8, <-12,3>, <-12,-3>, <-5,-7>, <5,-7>, <12,-3>, <12,3>, <5,7>, <-5,7> scale <2,8,2> translate <0,-4,0> } rotate <90,90,0> translate <-2.5,0,0> } union { cylinder{ <-2.5,0,0>,<2.5,0,0>,.5 translate <0,-3,-12> } sphere { <0,0,0>,.5 translate <2.5,-3,-12> } sphere { <0,0,0>,.5 translate <-2.5,-3,-12> } cylinder{ <0,-3,0>,<0,3,0>,.5 translate <-2.5,0,-12> } sphere { <0,0,0>,.5 translate <-2.5,3,-12> } cylinder{ <0,-3,0>,<0,3,0>,.5 translate <2.5,0,-12> } sphere { <0,0,0>,.5 translate <2.5,3,-12> } cylinder{ <2.5,3,-12>,<2.5,7,-5>,.5 } sphere { <0,0,0>,.5 translate <2.5,7,-5> } cylinder{ <-2.5,3,-12>,<-2.5,7,-5>,.5 } sphere { <0,0,0>,.5 translate <-2.5,7,-5> } } union { cylinder{ <-2.5,0,0>,<2.5,0,0>,.5 translate <0,-3,-12> } sphere { <0,0,0>,.5 translate <2.5,-3,-12> } sphere { <0,0,0>,.5 translate <-2.5,-3,-12> } cylinder{ <0,-3,0>,<0,3,0>,.5 translate <-2.5,0,-12> } sphere { <0,0,0>,.5 translate <-2.5,3,-12> } cylinder{ <0,-3,0>,<0,3,0>,.5 translate <2.5,0,-12> } sphere { <0,0,0>,.5 translate <2.5,3,-12> } cylinder{ <2.5,3,-12>,<2.5,7,-5>,.5 } sphere { <0,0,0>,.5 translate <2.5,7,-5> } cylinder{ <-2.5,3,-12>,<-2.5,7,-5>,.5 } sphere { <0,0,0>,.5 translate <-2.5,7,-5> } rotate <0,180,0> } object { rxChestSegment translate <8,0,0> } object { rxChestSegment translate <-8,0,0> } object { roundedPyramid(3.6,5,9.5, .3) translate <-8,7,-6> } object { roundedPyramid(3.64,5,9.5, .3) rotate <-20,0,0> translate <-8,6.6,-4.25> } object { roundedPyramid(3.6,5,9.5, .3) translate <8,7,-6> } object { roundedPyramid(3.64,5,9.5, .3) rotate <-20,0,0> translate <8,6.6,-4.25> } object { roundedCylinder(3,5) rotate <0,0,90> scale <1,1.3,.8> translate <0,5,1> } union { cylinder{ <0,0,0>, <0,5,0>, 2.5 } cone { <0,5,0>,2.3, <0,5.5,0>,1.8 } cone { <0,5.5,0>,1.1 <0,10,0>,.8 } object { roundedCylinder(10,1) rotate <0,0,90> scale <1,.5,3> translate <0,10.5,0> } translate <0,6.5,2> } union { cone { <0,0,0>,2, <0,0,-.5>,1.4 } difference { cylinder{ <0,0,0>, <0,0,-.6>, 1.2 } cylinder{ <0,0,0>, <0,0,-.7>, 1 } } sphere { <0,0,0>,1 scale <1,1,.5> translate <0,0,-.4> texture { pigment { rgb <.3,.3,.7>*.5 } finish { specular .31 roughness .11 } } } translate <8,9,-8> } cylinder{ <0,4,0>, <0,-.5,0>, 6 translate <0,-7,0> } cylinder{ <-13,0,0>, <13,0,0>, 4 } cone { <13,0,0>,4 <14,0,0>,0 } cone { <-13,0,0>,4 <-14,0,0>,0 } translate <0,7.5,0> } #end #declare rxGroin = union { cone { <0,.5,0>,9, <0,-1,0>,11 } difference { sphere { <0,0,0>,11 translate <0,-1,0> } box { <-12,-1,-12>, <12,13,12> } box { <-12,-10,-12>, <12,-15,12> } box { <3,-1,-12>, <12,-15,12> } box { <-3,-1,-12>, <-12,-15,12> } } } #macro rxFoot(FootRot) union { cylinder{ <-2.6,0,0>, <2.6,0,0> 2 } cylinder{ <-2.7,0,0>, <2.7,0,0> 1.7 } #declare rxx = 0; #while(rxx < 180) box { <-2.4,2.2 ,.05>, <2.4 ,-2.2,-.05> rotate } #declare rxx = rxx + 8; #end difference { sphere { <0,0,0>, 3 scale <2,1,3> translate <0,-3,-1> } box { <-7, -3, -12>, <7,-7,12> } cylinder{ <0,5,0>, <0,-5,0>, 2 scale <1,1,4> rotate <0,0,10> translate <6,0,0> } cylinder{ <0,5,0>, <0,-5,0>, 2 scale <1,1,4> rotate <0,0,-10> translate <-6,0,0> } box { <-6,4,2>, <6,-4,-2> rotate <40,0,0> translate <0,0,-8> } box { <-1.5,4,3>, <1.5,-4,-2> rotate <40,0,0> translate <0,0,-8> } } difference { cylinder{ <-5,0,0>, <5,0,0>, 4 scale <1,.3,1> translate <0,-3,0> } box { <-7, -3, -12>, <7,-7,12> } } box { <-4,-1,0>, <4,-3.3,1> } box { <-4,-1,0>, <4,-3.3,1> translate <0,0,-3> } box { <-4,-1,0>, <4,-3.3,1> translate <0,0,-5> } box { <-4,-1,0>, <4,-3.3,1> translate <0,0,2> } rotate FootRot translate <0,-1,0> } #end #macro rxLowerLeg(KneeRot, FootRot) union { difference { union { box { <3.2,-.2,3>, <-3.2,-10,-3> } cylinder{ <3.2,0,3>, <-3.2,0,3>, 2 scale <1,2.5,1> translate <0,-5,0> } } cylinder{ <3.3,0,-7>, <-3.3,0,-7>, 2 scale <1,2.5,.5> translate <0,-5,0> } } object { roundedPyramid(6.5,6.5,4, .3) scale <1,1.5,.7> translate <0,-5,1> } object { roundedCylinder(4,1) rotate <0,0,90> translate <0,-8,-2> } object { roundedCylinder(4,1) rotate <0,0,90> translate <0,-2,-1.75> } object { rxFoot(FootRot) translate <0,-10,0> } rotate KneeRot } #end #macro rxUpperLeg(HipRot,KneeRot,FootRot) union { difference { box { <3,4,3>, <-3,-9,-3> } cylinder{ <-3.1,0,0>, <3.1,0,0>, 2 scale <1,3,2> rotate <20,0,0> translate <0,-9,3.5> } } object { roundedCylinder(10,1) translate <-1,-2.5,-2.5> } object { roundedCylinder(10,1) translate <0,-2.5,-2.5> } object { roundedCylinder(10,1) translate <1,-2.5,-2.5> } object { roundedCylinder(5,1) translate <1,0,2.5> } object { roundedCylinder(5,1) translate <-1,0,2.5> } cylinder{ <-3.5,0,0>, <3.5,0,0>, 2.8 } cylinder{ <-4,0,0>, <4,0,0>, 2.4 } cylinder{ <-5,0,0>, <5,0,0>, 2 } union { cylinder{ <-2.6,0,0>, <2.6,0,0> 2 } cylinder{ <-2.7,0,0>, <2.7,0,0> 1.7 } #declare rxx = 0; #while(rxx < 180) box { <-2.4,2.2 ,.05>, <2.4 ,-2.2,-.05> rotate } #declare rxx = rxx + 8; #end translate <0,-8,0> } object { rxLowerLeg(KneeRot, FootRot) translate <0,-9,0> } rotate HipRot } #end #macro rxLeg(HipRot, KneeRot, FootRot) object { rxUpperLeg(HipRot,KneeRot,FootRot) texture { rxTexture } } #end #macro raiderMech(TorsoRot, LeftArmRot, RightArmRot, LeftHipRot, LeftKneeRot, LeftFootRot , RightHipRot, RightKneeRot, RightFootRot) union { object { rxUpperTorso(LeftArmRot, RightArmRot) rotate TorsoRot } object { rxGroin } object { rxLeg( LeftHipRot, LeftKneeRot, LeftFootRot) translate <-6,-6,0> scale 1.2 } object { rxLeg( RightHipRot, RightKneeRot, RightFootRot) translate <6,-6,0> scale 1.2 } texture { rxTexture } } #end