// Last edited on DATE TIME by USER // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.2 } } #declare tx_plastico_vermelho = texture{ pigment{ color rgb < 1, 0, 0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.2 } } #declare tx_canudo = texture{ pigment{ color rgb < 1, 1.0, 1.0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.2 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 1.00, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> texture {tx_plastico}} #macro Interpola2(p0,p1,tt) ((1-tt)*p0 + tt*p1) #end #macro Interpola4(p0,p1,p2,p3,tt) #local p01 = Interpola2(p0,p1,tt); #local p12 = Interpola2(p1,p2,tt); #local p23 = Interpola2(p2,p3,tt); #local p012 = Interpola2(p01, p2, tt); #local p123 = Interpola2(p12, p3, tt); #local p0123 = Interpola2(p012,p123,tt); p0123 #end #macro desenhaLinha(p0,p1) #declare i = 0; #while(i <= 1) object{sphere{Interpola2(p0,p1,i), 0.1 texture {tx_plastico}}} #declare i = i + 0.1; #end #end #macro desenhaCurva(p0,p1,p2,p3,r1,r2) #declare i = 0; #while(i <= 1) object{sphere{Interpola4(p0,p1,p2,p3,i), Interpola2(r1,r2,i) texture {tx_plastico}}} #declare i = i + 0.01; #end #end #macro criaCurvas(p0,p1,p2,q0,q1,q2) #local m = (p2+q0)/2; desenhaCurva(p0,p1,p2,m) desenhaCurva(m,q0,q1,q2) #end #macro tentaculo(p0,p1,p2,q0,q1,q2,r1,r2) union{ #local m = (p2+q0)/2; #local rm = (r1+r2)/2; #declare tt2 = desenhaCurva(p0,p1,p2,m,r1,rm) desenhaCurva(m,q0,q1,q2,rm,r2) } #end #macro tentaculo_vetor(vet,q,tent) object{tentaculo(,,,,,, 0.5, 0.1)} #end #macro polvo_quadro(q, nq) union{ difference{ object{sphere{<0,0,1.5>, 1.2 texture{tx_plastico}}} object{sphere{<1.0,0.55,1.3>, 0.1 texture{tx_plastico_vermelho}}} } object{sphere{<1.0,0.1,1.9>, 0.2 texture{tx_canudo}}} object{sphere{<0.65,0.8,1.9>, 0.2 texture{tx_canudo}}} object{sphere{<1.12,0.22,1.9>, 0.05 texture{tx_plastico_vermelho}}} object{sphere{<0.82,0.83,1.9>, 0.05 texture{tx_plastico_vermelho}}} object{tentaculo_vetor(q, nq, 0) rotate<0,0,45>} object{tentaculo_vetor(q, nq, 1) rotate<0,0,90>} object{tentaculo_vetor(q, nq, 2) rotate<0,0,135>} object{tentaculo_vetor(q, nq, 3) rotate<0,0,180>} object{tentaculo_vetor(q, nq, 4) rotate<0,0,225>} object{tentaculo_vetor(q, nq, 5) rotate<0,0,270>} object{tentaculo_vetor(q, nq, 6) rotate<0,0,315>} object{tentaculo_vetor(q, nq, 7) rotate<0,0,360>} } #end #macro cria_polvo_animado() #declare nq = 5; //Numero de quadros chave #declare nt = 8; //Numero de tentaculos #declare np = 18; //Numero de parametros por tentaculo #declare d = array[7]{0.0, 0.2, 0.35, 0.5, 0.7, 0.9, 1.0} //Tempo de cada quadro chave #local a0 = array[18]{0,0,0,1,1,1,1.5,1.5,0.5,2,2,0,2.5,2.5,-0.5,3,3,0.25}; #local a1 = array[18]{0,0,0,0,0,0,1.5,1.5,0.5,1,1,2,2.5,2.5,-0.5,3,3,0.25}; #local a2 = array[18]{0,0,0,1.5,1.5,1.5,1.5,1.5,0.5,2,2,0,2.5,2.5,-0.5,3,3,0.25}; #local a3 = array[18]{0,0,0,1,1,1,1.5,1.5,0.5,2,2,0,2.5,2.5,-0.5,3,3,0.25}; #declare q = array[nq+1][nt][np]{ {{0,0,0,1,1,1,1.5,1.5,0.5,2,2,0,2.5,2.5,0,3,3,0.25}, {0,0,0,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25}, {0,0,0,1,1,1,1.5,1.5,0.5,2,2,0,2.5,2.5,-0.5,3,3,0.25}}, {{0,0,0,1,1,1,1.5,1.5,0.5,2,2,0,2.5,2.5,0,3,3,0.25}, {0,0,0,2,2,2,1.5,1.5,1.5,2,2,0,2.5,2.5,-0.5,3,3,0.25}, {0,0,0,1,1,1,1.5,1.5,0.5,2,2,0,2.5,2.5,-0.5,3,3,1.5}, {0,0,0,1,1,1,1.5,1.5,0.5,2,2,0,2.5,2.5,-0.5,3,3,-1}, {0,0,0,1,1,1,1.5,1.5,0.5,2,2,0,2.5,2.5,-0.5,3,3,0.75}, {0,0,0,1,1,1,0.5,0.5,0,2,2,0,2.5,2.5,-0.5,3,3,0.25}, {0,0,0,1,1,1,0.5,0.5,0,2,2,0,2.5,2.5,-0.5,3,3,-1}, {0,0,0,1,1,1,1.5,1.5,0.5,2,2,0,2.5,2.5,-0.5,3,3,0.25}} } object{polvo_animado(q,5,d,clock)} #end #macro polvo_animado(q,nq, d, tempo) #if(tempo <0.2) #local i = 0; #else #if(tempo < 0.35) #local i = 1; #else #if(tempo < 0.5) #local i = 2; #else #if(tempo < 0.7) #local i = 3; #else #if(tempo < 0.9) #local i = 4; #else #if(tempo <= 1) #local i = 5; #end #end #end #end #end #end object{polvo_quadro(q,i)} #end #macro polvo() union{ difference{ object{sphere{<0,0,1.5>, 1.2 texture{tx_plastico}}} object{sphere{<1.0,0.55,1.3>, 0.1 texture{tx_plastico_vermelho}}} } object{sphere{<1.0,0.1,1.9>, 0.2 texture{tx_canudo}}} object{sphere{<0.65,0.8,1.9>, 0.2 texture{tx_canudo}}} object{sphere{<1.12,0.22,1.9>, 0.05 texture{tx_plastico_vermelho}}} object{sphere{<0.82,0.83,1.9>, 0.05 texture{tx_plastico_vermelho}}} #local a0 = array[18]{0,0,0,1,1,1,1.5,1.5,0.5,2,2,0,2.5,2.5,-0.5,3,3,0.25}; #local a1 = array[18]{0,0,0,0,0,0,1.5,1.5,0.5,1,1,2,2.5,2.5,-0.5,3,3,0.25}; #local a2 = array[18]{0,0,0,1.5,1.5,1.5,1.5,1.5,0.5,2,2,0,2.5,2.5,-0.5,3,3,0.25}; #local a3 = array[18]{0,0,0,1,1,1,1.5,1.5,0.5,2,2,0,2.5,2.5,-0.5,3,3,0.25}; object{tentaculo_animado(a0, a1, a2, a3, clock) rotate<0,0,45>} object{tentaculo_animado(a0, a1, a2, a3, clock) rotate<0,0,90>} object{tentaculo_animado(a0, a1, a2, a3, clock) rotate<0,0,135>} object{tentaculo_animado(a0, a1, a2, a3, clock) rotate<0,0,180>} object{tentaculo_animado(a0, a1, a2, a3, clock) rotate<0,0,225>} object{tentaculo_animado(a0, a1, a2, a3, clock) rotate<0,0,270>} object{tentaculo_animado(a0, a1, a2, a3, clock) rotate<0,0,315>} object{tentaculo_animado(a0, a1, a2, a3, clock) rotate<0,0,360>} } #end #include "eixos.inc" union{ object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } object{cria_polvo_animado()} } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 6.0; #declare dir_camera = < 14.00, 7.0, 4.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)