// Last edited on 2009-07-24 17:06:55 by stolfilocal // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare BLUE = texture { pigment { color rgb < 0.30, 0.50, 1.00 > } finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 } } #declare YELLOW = texture { pigment { color rgb < 1.0, 1.0, 0.0 > } finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 } } #declare GREEN = texture { pigment { color rgb < 0.20, 0.80, 0.10 > } finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 } } #declare RED = texture { pigment { color rgb < 1.00, 0.00, 0.00 > } finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 } } #declare SILVER = texture { pigment { color rgb < 0.86, 0.86, 0.86 > } finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 } } #declare GOLDENROD = texture { pigment { color rgb < 0.854, 0.64, 0.125 > } finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 } } #declare cutter = difference{ box{ <0,-2,-1> <1,2,2> } box{ <0,-3,0> <5,3,2> rotate <0, 75, 0> translate <-0.2,0,3> } } #declare def_length = 4; #declare sphere_radius = 1.2; #declare knife_obj = difference{ box{ <0,0,-1> <10,1,1> } object{cutter translate <-0.2,0,0> scale<1,1,1.5>} object{cutter translate <1,0,-2>} object{cutter translate <1.5,0,-2>} object{cutter translate <2,0,-2>} object{cutter translate <2.5,0,-2>} object{cutter translate <3,0,-2>} translate <-10, -1, 0> rotate <0,0,180> } #declare arm_obj = merge{ box{ <0,0,-1> } sphere{ ,sphere_radius } } #declare base = box{ <-2,0,-4> <5,2,5> } #macro knife_leaf() object{knife_obj} #end #macro arm0(knife_y) merge{ object{arm_obj} object{ knife_leaf() rotate <0, knife_y, 0> translate } } #end #macro arm1(arm0_y, knife_y) merge{ object{arm_obj} object{arm0(knife_y) rotate <0, arm0_y, 0> translate } } #end #macro arm2(arm1_y, arm1_z, arm0_y, knife_y) merge{ object{arm_obj} object{arm1(arm0_y, knife_y) rotate <0, arm1_y, arm1_z> translate } } #end #macro fancy_knife(arm2_y, arm2_z, arm1_y, arm1_z, arm0_y, knife_y) merge{ object{base} merge{ sphere{ <0,0,0>, sphere_radius } object{arm2(arm1_y, arm1_z, arm0_y, knife_y)} rotate <0, arm2_y, arm2_z> translate <1, -1, 3> } } #end #declare c0 = 0.0; #declare c1 = 1/6; #declare c2 = 2/6; #declare c3 = 3/6; #declare c4 = 4/6; #declare c5 = 5/6; #declare c6 = 6/6; #macro draw_knife_cut_storyboard() #declare nh = 5; #declare nv = 4; #declare nframes = nh*nv; #declare cini = 0.0; #declare cfin = 1.0; #declare cstep = (cfin - cini)/(nframes - 0.9999); #declare ck = cini; #declare iv = 0; union{ #while(iv < nv) #declare ih = 0; #while(ih < nh) #if ((ck >= c0) & (ck < c1)) #declare rr = (ck - c0)/(c1 - c0); #declare ss = (c1 - ck)/(c1 - c0); #declare arm2_y = 45*ss + 60*rr; #declare arm1_y = -45*ss - 60*rr; #declare knife_y = 45*ss + 30*rr; #end #if((ck >= c1) & (ck < c2)) #declare rr = (ck - c1)/(c2 - c1); #declare ss = (c2 - ck)/(c2 - c1); #declare arm2_y = 60*ss + 75*rr; #declare arm1_y = -60*ss - 75*rr; #declare knife_y = 30*ss + 15*rr; #end #if((ck >= c2) & (ck < c3)) #declare rr = (ck - c2)/(c3 - c2); #declare ss = (c3 - ck)/(c3 - c2); #declare arm2_y = 75*ss + 90*rr; #declare arm1_y = -75*ss - 90*rr; #declare knife_y = 15*ss + 0*rr; #end #if((ck >= c3) & (ck < c4)) #declare rr = (ck - c3)/(c4 - c3); #declare ss = (c4 - ck)/(c4 - c3); #declare arm2_y = 90*ss + 75*rr; #declare arm1_y = -90*ss - 75*rr; #declare knife_y = 0*ss + 15*rr; #end #if((ck >= c4) & (ck < c5)) #declare rr = (ck - c4)/(c5 - c4); #declare ss = (c5 - ck)/(c5 - c4); #declare arm2_y = 75*ss + 60*rr; #declare arm1_y = -75*ss - 60*rr; #declare knife_y = 15*ss + 30*rr; #end #if((ck >= c5) & (ck < c6)) #declare rr = (ck - c5)/(c6 - c5); #declare ss = (c6 - ck)/(c6 - c5); #declare arm2_y = 60*ss + 45*rr; #declare arm1_y = -60*ss - 45*rr; #declare knife_y = 30*ss + 45*rr; #end object{fancy_knife(arm2_y, 0, arm1_y, 0, 0, knife_y) scale <0.2,0.2,0.2> translate <((ih+0.5)/nh)*25, 0,-((iv+0.5)/nv)*12> } #declare ck = ck + cstep; #declare ih = ih + 1; #end #declare iv = iv + 1; #end } #end object{draw_knife_cut_storyboard() texture{BLUE}} // Original camera parameters: // #local cam_ctr = <15.00,3.00,-3.00> // #local cam_vec = (<15.0,-10.00,0.00>-<15.00,3.00,-3.00>) // #local cam_sky = z #include "camlight.inc" camlight(<15.00,3.00,-3.00>,<4,10,3>,28.0,z,1.0)