//#include "colors.inc" //#include "textures.inc" //NOT NEEDED WHEN USED AS AN INCLUDE FILE #declare blade = difference { #declare magicbox = box { <-.1,0,-.1> <.1,-3,.1> rotate 45*y} union { object {magicbox} intersection { object {magicbox translate -.5*x rotate 60*z} object {magicbox translate .5*x rotate -60*z} scale <.8,4,1> translate y*1.1 } intersection { object {magicbox translate <0,1,0> rotate 30*z} object {magicbox translate <0,1,0> rotate -30*z} object {magicbox} translate -3*y } } merge { sphere {< 0, -.5, sqrt(.08)/2> .08} sphere {< 0, -3, sqrt(.08)/2> .08} cylinder {< 0, -.5, sqrt(.08)/2> < 0, -3, sqrt(.08)/2> .08} sphere {< 0, -.5, -sqrt(.08)/2> .08} sphere {< 0, -3, -sqrt(.08)/2> .08} cylinder {< 0, -.5, -sqrt(.08)/2> < 0, -3, -sqrt(.08)/2> .08} } scale <1.3,1,.3> texture{pigment{color rgb .5} finish {reflection .7}} } #declare n = 4 #declare th = 180/n #declare s = sin(radians(th))/(1+sin(radians(th))) #declare l = s/tan(radians(th)) #declare h = sin(radians(th)) #declare firstsplice = intersection { cylinder { 0 .1*z 1 } //This is the large circle, of radius R, and R happens to equal 1 plane {y h} // This is the first planar cut, which is D units away from the center ^ plane {(-1*y) h} plane {(-1*x) (-1*l)} } #declare fourthsplice = difference { object {firstsplice} //Commenting here would be redundant cylinder { s-.00001} // The bottom circle... } #declare gms = merge { object{fourthsplice} //Whew, all that work's paying off... cylinder{ s} // SHOULD be a mirror image of the bottom circle over x axis... } #declare counter = 0 #declare metaphysicmerge = merge { #while (n >= counter) object {gms rotate z*((360/n)*counter) } #declare counter = counter + 1 #end } #declare centerstar = intersection { cylinder {0 .1*z 1-s} difference { cylinder {-.1*z .2*z 1} object{ metaphysicmerge translate -.05*z scale <1,1,100> } } } #declare hilt = union { union { cylinder {<0,0,0> <0,1.1,0> .12 scale <1,1,.3>} sphere {<0,1.1,0> .15} union { cylinder { 0 <-.7,-.2,0> .1 } cylinder { 0 <.7,-.2,0> .1 } sphere { <-.7,-.2,0> .13 } sphere { <.7,-.2,0> .13 } scale <1,1,.3> } texture {pigment {color rgb .4} finish {phong .3 reflection .3}} } object { centerstar scale sqrt(.08) scale <5,5,4> translate -.3*sqrt(.08)*.5*z texture{pigment{color rgb <0,0,.6>} finish {reflection .7}} } sphere {0 .2 texture{pigment{color rgb <0,.8,1>} finish {phong .3 reflection .5}} scale <1,1,.35>} } #declare sword = union { object {hilt} object {blade scale <1,1.1,1>} // finish {phong 1 reflection 1} } //USEFUL ONLY FOR EDITING THE OBJECT!!! sphere {0 100 texture{Shadow_Clouds scale 8} clipped_by {plane {z 0}}} object {sword} light_source { <3,3,-3> color White rotate y*90 } camera { location <0,-2,-8> look_at <0,-2,0> }