// Last edited on DATE TIME by USER // Processed by remove-cam-lights #include "colors.inc" #include "textures.inc" #include "woods.inc" #include "stones.inc" background{ color rgb <0.75, 1, 1 > } #declare tx = texture{ pigment { color Blue } finish { phong 1 } } #declare raioEsfera = 0.5; #declare alturaCone = 2; #declare raioMaiorCone = 1; #declare raioMenorCone = raioEsfera/4; #declare larguraPerna = 0.3; #declare alturaCoxa = 2; #declare alturaCanela = 2; #declare comprPe = 0.9; #declare larguraPe = 0.3; #declare alturaSaltopode = alturaCoxa+alturaCanela+larguraPe*2; #declare chao = box{ <-10,-10,-10>, <+20,+20,-alturaSaltopode>} #declare bolinha = sphere { <0, 0, 0>, raioEsfera} #declare bolaArticulacao = sphere { <0, 0, 0>, 0.3} #declare corpo = cone{<0.00, 0.00, 0>, raioMaiorCone, <0.00, 0.00, alturaCone>, raioMenorCone } #declare canela = cylinder{ < 0.00, 0.00, 0>, < 0.00, 0, -alturaCanela>, larguraPerna } #declare coxa = cylinder{ < 0.00, 0.00, 0>, < 0.00, 0, -alturaCoxa>, larguraPerna } #macro pe() object { cylinder{ < 0.00, 0.00, 0>, < comprPe, 0, 0>, larguraPe } } #end #macro anteperna(angPe) union { object {canela} object {pe() rotate y*-angPe translate <0,0,-alturaCanela> } } #end #macro perna(angAntePerna, angPe) union { object {coxa} object {bolaArticulacao translate <0,0,-alturaCoxa>} object {anteperna(angPe) rotate y*angAntePerna translate <0,0,-alturaCoxa>} } #end #macro braco() union { cone{ < 0.00, 0.00, 0>, larguraPerna*0.85, < 0.00, alturaCanela, 0>, larguraPerna*0.35 } } #end #macro saltopode(angPerna, angAntePerna, angPe, angBraco) union { object {bolinha translate <0,0,alturaCone>} object {corpo} object {braco() rotate translate <0, ((raioMaiorCone+raioMenorCone)/2-0.3), alturaCone/2>} object {braco() rotate translate <0, -((raioMaiorCone+raioMenorCone)/2)+0.3, alturaCone/2>} object {perna(angAntePerna, angPe) rotate y*-angPerna translate y*-larguraPerna*1.2} object {perna(angAntePerna, angPe) rotate y*-angPerna translate y*larguraPerna*1.2} } #end #macro interpola(ta, va, tb, vb, tt) #local s = (tt-ta)/(tb-ta); ((1-s)*va + s*vb) #end #macro armacao(fase) #local fase0 = 0; #local fase1 = 0.25; #local fase2 = 0.5; #local fase3 = 0.75; #local fase4 = 1; #local angPe0 = 0; #local angPe1 = 10; #local angPe2 = 20; #local angPe3 = 30; #local angPe4 = 20; #local angPerna0 = 0; #local angPerna1 = 50; #local angPerna2 = 80; #local angPerna3 = 60; #local angPerna4 = 50; #local angCanela0 = 0; #local angCanela1 = 60; #local angCanela2 = 120; #local angCanela3 = 100; #local angCanela4 = 90; #local angBraco = -45; #if ((fase >= fase0) & (fase <= fase1)) #local angPerna = interpola(fase0, angPerna0, fase1, angPerna1, fase); #local angPe = interpola(fase0, angPe0, fase1, angPe1, fase); #local angCanela = interpola(fase0, angCanela0, fase1, angCanela1, fase); #end #if ((fase >= fase1) & (fase <= fase2)) #local angPerna = interpola(fase1, angPerna1, fase2, angPerna2, fase); #local angPe = interpola(fase1, angPe1, fase2, angPe2, fase); #local angCanela = interpola(fase1, angCanela1, fase2, angCanela2, fase); #end #if ((fase >= fase2) & (fase <= fase3)) #local angPerna = interpola(fase2, angPerna2, fase3, angPerna3, fase); #local angPe = interpola(fase2, angPe2, fase3, angPe3, fase); #local angCanela = interpola(fase2, angCanela2, fase3, angCanela3, fase); #end #if ((fase >= fase3) & (fase <= fase4)) #local angPerna = interpola(fase3, angPerna3, fase4, angPerna4, fase); #local angPe = interpola(fase3, angPe3, fase4, angPe4, fase); #local angCanela = interpola(fase3, angCanela3, fase4, angCanela4, fase); #end object {saltopode(angPerna, angCanela, angPe, angBraco) texture{Silver_Metal}} #end #macro voo(altura, fase) #local fase0 = 0; #local fase1 = 0.4; #local fase2 = 0.6; #local fase3 = 1; #local angPe0 = 20; #local angPe1 = -30; #local angPe2 = 15; #local angPe3 = 0; #local angPerna0 = 50; #local angPerna1 = 0; #local angPerna2 = 0; #local angPerna3 = 0; #local angCanela0 = 90; #local angCanela1 = 0; #local angCanela2 = 45; #local angCanela3 = 0; #local angBraco = 60; #if ((fase >= fase0) & (fase <= fase1)) #local angPerna = interpola(fase0, angPerna0, fase1, angPerna1, fase); #local angPe = interpola(fase0, angPe0, fase1, angPe1, fase); #local angCanela = interpola(fase0, angCanela0, fase1, angCanela1, fase); #end #if ((fase >= fase1) & (fase <= fase2)) #local angPerna = interpola(fase1, angPerna1, fase2, angPerna2, fase); #local angPe = interpola(fase1, angPe1, fase2, angPe2, fase); #local angCanela = interpola(fase1, angCanela1, fase2, angCanela2, fase); #end #if ((fase >= fase2) & (fase <= fase3)) #local angPerna = interpola(fase2, angPerna2, fase3, angPerna3, fase); #local angPe = interpola(fase2, angPe2, fase3, angPe3, fase); #local angCanela = interpola(fase2, angCanela2, fase3, angCanela3, fase); #end object {saltopode(angPerna, angCanela, angPe, angBraco) texture{Silver_Metal} translate <0,0, altura*sin(fase*pi)> rotate <0, 0, 360*fase> } #end #macro voo_geral(altura, p, q, fase) #local r = interpola(0,p,1,q, fase); object{voo(altura, fase) translate r} #end #macro armacao_geral(p, fase) object{armacao(fase) translate p} #end #macro quadro(tt) #local t0 = 0.00; #local t1 = 0.25; #local t2 = 0.50; #local t3 = 0.75; #local t4 = 1.00; #local a = <0,0,0>; #local b = <0,3,0>; #if ((tt >= t0) & (tt <= t1)) #local fase = interpola(t0, 0, t1, 1, tt); object{armacao_geral(a, fase)} #end #if ((tt >= t1) & (tt <= t2)) #local fase = interpola(t1, 0, t2, 1, tt); object{voo_geral(5, a, b, fase)} #end #if ((tt >= t2) & (tt <= t3)) #local fase = interpola(t2, 0, t3, 1, tt); object{armacao_geral(b, fase)} #end #if ((tt >= t3) & (tt <= t4)) #local fase = interpola(t3, 0, t4, 1, tt); object{voo_geral(2, b, a, fase)} #end #end #include "eixos.inc" union{ object{ eixos(3.00) } object{ chao texture{tx}} object{ quadro(clock) } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 10.0; #declare dir_camera = < 3, 3, 1 >; #declare dist_camera = 10.0; #declare intens_luz = 2.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)