// Last edited on 2010-12-16 00:48:23 by stolfilocal // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #include "textures.inc" #declare tx_plastico = texture{ pigment{ color rgb < 0.30, 0.95, 0.10 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_blue = texture{ pigment{ color rgb < 0.30, 0.5, 0.90 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_yellow = texture{ pigment{ color rgb < 1, 1, 0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_black = texture{ pigment{ color rgb < 0, 0, 0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_green = texture{ pigment{ color rgb < 0.30, 0.9, 0.20 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_marrom = texture{ pigment{ color rgb < 0.55, 0.15, 0.45 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_head = texture{ pigment{ color rgb < 0.90, 0.15, 0.10 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 0.75, 0.25, 0.05 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } #declare chao = box{ <-100,-100,-1>, <100,100,0> } #declare pe = box { <0,0,0> <1,3,1> texture {tx_head} } #macro canela (angulo) union { box{ <0,0,0> <1,1,-4> texture{tx_head} } object {pe rotate angulo*x translate <0,0.3,-5>} } #end #macro coxa (tornozelo,joelho) union { box { <0,0,0> <1,1,-3> texture {tx_blue} } object {canela(tornozelo) rotate joelho*x translate <0,0,-3>} } #end #declare angulo = 15 + 45*sin(3*2*pi*clock); #declare baseCorpo = sphere { <0,0,0> 3 texture {tx_plastico} } #macro corpo(tamanho) union { #declare i=0; #while (i} #declare i=i+1; #end } #end #macro chassis(tornozelo,joelho,juntaCorpo) union{ object {baseCorpo} object {coxa(tornozelo,joelho) rotate juntaCorpo*x translate<2,0.5,-1.5>} object {coxa(tornozelo,joelho) rotate juntaCorpo*x translate<-2,0.5,-1.5>} } #end #macro interpola(ta,va,tb,vb,tt) #local s=(tt-ta)/(tb-ta); ((1-s)*va +s*vb) #end #macro voo(h,fase) union{ #local t0=0.000; #local t1=0.500; #local t2=1; #if ((fase >= t0) & (fase<=t1)) #local tornozelo=0; #local joelho=0; #local juntaCorpo=0; #local altura = interpola (t0,0,t1,h,fase); #end #if ((fase > t1) & (fase<=t2)) #local tornozelo = interpola (t1,0,t2,30,fase); #local joelho = interpola (t1,0,t2,-45,fase); #local juntaCorpo = interpola (t1,0,t2,15,fase); #local altura = interpola (t1,h,t2,0,fase); #end object {chassis(tornozelo,joelho,juntaCorpo) translate <0,0,5+altura>} } #end #macro armacao(fase) union{ #local t0=0.000; #local t1=0.500; #local t2=1; #if ((fase >= t0) & (fase<=t1)) #local tornozelo = interpola (t0,30,t1,45,fase); #local joelho = interpola (t0,-45,t1,-90,fase); #local juntaCorpo = interpola (t0,15,t1,30,fase); #local altura = interpola (t0,0,t1,-2.1,fase); #end #if ((fase > t1) & (fase<=t2)) #local tornozelo = interpola (t1,45,t2,0,fase); #local joelho = interpola (t1,-90,t2,0,fase); #local juntaCorpo = interpola (t1,30,t2,0,fase); #local altura = interpola (t1,-2.1,t2,0,fase); #end object {chassis(tornozelo,joelho,juntaCorpo) translate <0,0,5+altura>} } #end #macro armacaogeral(p,fase) object {armacao(fase) translate p} #end #macro voogeral(h,p,q,fase) #local r= interpola(0,p,1,q,fase); object {voo(h,fase) translate r} #end #macro quadro (tt) #local t0=0.000; #local t1=0.200; #local t2=0.500; #local t3=0.700; #local t4=1.000; #local A = <0,-15,1>; #local B = <0,0,5>; #local C = <0,15,1>; #local hAB=5; #local hBC=5; #if ((tt>=t0) &(tt<=t1)) #local fase = interpola(t0,0,t1,1,tt); object{armacaogeral(A,fase)} #end #if ((tt>t1) &(tt<=t2)) #local fase = interpola(t1,0,t2,1,tt); object{voogeral(hAB,A,B,fase)} #end #if ((tt>t2) &(tt<=t3)) #local fase = interpola(t2,0,t3,1,tt); object{armacaogeral(B,fase)} #end #if ((tt>t3) &(tt<=t4)) #local fase = interpola(t3,0,t4,1,tt); object{voogeral(hBC,B,C,fase)} #end #end union{ object {chao texture {tx_xadrez} translate<0,0,-5>} cylinder {<0,0,-5> <0,0,-4> 3 texture{tx_plastico} translate<0, -45,0>} cylinder {<0,0,-5> <0,0,-0> 3 texture{tx_plastico} translate<0, -30,0>} cylinder {<0,0,-5> <0,0,-4> 3 texture{tx_plastico} translate<0,-15,0>} cylinder {<0,0,-5> <0,0,0> 3 texture{tx_plastico} translate<0,0,0>} cylinder {<0,0,-5> <0,0,-4> 3 texture{tx_plastico} translate<0, 15,0>} cylinder {<0,0,-5> <0,0,-0> 3 texture{tx_plastico} translate<0, 30,0>} cylinder {<0,0,-5> <0,0,-4> 3 texture{tx_plastico} translate<0, 45,0>} object {quadro(clock)} } #include "camlight.inc" #declare centro_cena = < 0.00, interpola(0,-15,1,15,clock), 1.00 >; #declare raio_cena = 25.0; #declare dir_camera = < 8.00, 10.00, 10 >; #declare dist_camera = 60.0; #declare intens_luz = 2.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)