// Exemplo de arquivo de descricao de ANIMAÇÃO para POV-ray // Last edited on 2009-09-24 15:40:22 by stolfi #macro quadro(tt) // Gera o quadro do filme (cena, luzes e câmera) // para o instante {tt} -- um número real entre 0 e 1. // ====================================================================== // CÂMERA #include "eixos.inc" #include "retalho.inc" #include "camlight.inc" #declare centro_cena = < 0.00, 00.00, 0.00 >; #declare raio_cena = 50; #declare dir_camera = < 101.0, 50.0, 30.10 >; #declare dist_camera = 50.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz) // Nota: os parâmetros "right" e "up" devem ter a mesma proporção // que os parâmetros ${WIDTH} e ${HEIGHT} no Makefile. // ====================================================================== // FONTES DE LUZ light_source { 10 * < +50.0, +30.0, +50.0 > // Posição da lâmpada. color rgb 1.2 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { 10 * < +50.0, -10.0, +10.0 > // Posição da lâmpada. color rgb 0.8 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA //background{ color rgb < 0.75, 0.80, 0.85 > } background{ color rgb < 0.75, 0.80, 0.85 > } #declare marrom = texture{ pigment{ color rgb < 0.9, 0.2, 0.2 > } finish{ diffuse 0.8 ambient 0.01 specular 0.5 roughness 0.005 } } #declare tx_bandeira = texture{ uv_mapping pigment{ image_map{jpeg "bandeira.jpg" } translate<-1/2,-1/2,0> rotate -90*z translate<1/2,1/2,0> } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_grito = texture{ pigment{ image_map{jpeg "grito.jpg" } translate<-1/2,-1/2,0> rotate -90*z } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005} } #declare lol = texture{ pigment{ color rgb < 0.0, 0.5, 0.8 > } finish{ diffuse 0.8 ambient 0.01 specular 0.5 roughness 0.005 } } #declare verde = texture{ pigment{ color rgb < 0.15, 0.90, 0.15 > } finish{ diffuse 0.8 ambient 0.01 specular 0.5 roughness 0.005 } } #declare tx_plastico = texture{ pigment{ color rgb < 0.80, 0.90, 0.90 > } finish{ diffuse 0.8 ambient 0.01 specular 0.5 roughness 0.005 } } #declare tx_plastico2 = texture{ pigment{ color rgb < 0.90, 0.90, 0.90 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca2 = texture{ pigment{ color rgb < 0.50, 0.50, 0.10 > } 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.05 } } #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 raio = 10.000; // Um parãmetro que varia {+1, 00, -1, 00, +1}: #declare ctt = cos(2*pi*tt); // Um parâmetro que varia {00, +1, 00, -1, 00}: #declare stt = sin(2*pi*tt); #local a11 = <0,0, 0>; #local a12 = <0,4,-3>; #local a13 = <0,8,-3>; #local a14 = <0,12,-3>; #local a21 = < 0,0,0>; #local a22 = < 3,4,-2>; #local a23 = < 4,8,-2>; #local a24 = <0,12,-2>; #local a31 = < 0,0,0>; #local a32 = < 2,4,5>; #local a33 = < 2,8,2>; #local a34 = <0,12,2>; #local a41 = < 0,0,0>; #local a42 = < 2,4,3>; #local a43 = < 2,8,3>; #local a44 = <0,12,3>; #local b11 = < 3,16,-3>; #local b12 = < 3,20,-3>; #local b13 = < 3,24,-3>; #local b14 = < 3,28,-3>; #local b21 = < 5,16,-2>; #local b22 = < 5,20,-2>; #local b23 = < 5,24,-2>; #local b24 = < 5,28,-2>; #local b31 = < 2,16,2>; #local b32 = < 2,20,2>; #local b33 = < 2,24,2>; #local b34 = < 2,28,2>; #local b41 = < 1,16,3>; #local b42 = < 1,20,3>; #local b43 = < 1,24,3>; #local b44 = < 1,28,3>; #local c11 = < 3,32,-3>; #local c12 = < 3,34,-3>; #local c13 = < 3,36,-3>; #local c14 = < 0,36,0>; #local c21 = < 5,32,-2>; #local c22 = < 5,34,-2>; #local c23 = < 5,36,-3>; #local c24 = < 0,36,0>; #local c31 = < 2,32,2>; #local c32 = < 2,34,2>; #local c33 = < 2,36,12>; #local c34 = < 0,36,0>; #local c41 = < 1,32,3>; #local c42 = < 1,34,3>; #local c43 = < 1,36,3>; #local c44 = < 0,36,0>; #declare haste = cylinder{<0,0,0><0,0,2> 0.1} #declare asa = box{<-1,-1,-1><1,1,1>} #macro deform1(p) #local cons = 2*sin(pi+p.y/18); #end #macro deform2(p) #local cons = 2*cos(pi+p.y/18); <0, 0, p.z*cons> #end #macro aviao(a22,a23,a32,a33,b22,b23,b32,b33,c22,c23,c32,c33) #local a14 = (a13 + b12)/2; #local b11 = a14; #local a24 = (a23 + b22)/2; #local b21 = a24; #local a34 = (a33 + b32)/2; #local b31 = a34; #local a44 = (a43 + b42)/2; #local b41 = a44; #local a11 = <0,a21.y, a21.z>; #local a12 = <0,a22.y, a22.z>; #local a13 = <0,a23.y, a23.z>; #local a14 = <0,a24.y, a24.z>; #local b11 = <0,b21.y, b21.z>; #local b12 = <0,b22.y, b22.z>; #local b13 = <0,b23.y, b23.z>; #local b14 = <0,b24.y, b24.z>; #local a41 = <0,a31.y, a31.z>; #local a42 = <0,a32.y, a32.z>; #local a43 = <0,a33.y, a33.z>; #local a44 = <0,a34.y, a34.z>; #local b41 = <0,b31.y, b31.z>; #local b42 = <0,b32.y, b32.z>; #local b43 = <0,b33.y, b33.z>; #local b44 = <0,b34.y, b34.z>; #local b14 = (b13 + c12)/2; #local c11 = b14; #local b24 = (b23 + c22)/2; #local c21 = b24; #local b34 = (b33 + c32)/2; #local c31 = b34; #local b44 = (b43 + c42)/2; #local c41 = b44; #local b11 = <0,b21.y, b21.z>; #local b12 = <0,b22.y, b22.z>; #local b13 = <0,b23.y, b23.z>; #local b14 = <0,b24.y, b24.z>; #local c11 = <0,c21.y, c21.z>; #local c12 = <0,c22.y, c22.z>; #local c13 = <0,c23.y, c23.z>; #local c14 = <0,c24.y, c24.z>; #local b41 = <0,b31.y, b31.z>; #local b42 = <0,b32.y, b32.z>; #local b43 = <0,b33.y, b33.z>; #local b44 = <0,b34.y, b34.z>; #local c41 = <0,c31.y, c31.z>; #local c42 = <0,c32.y, c32.z>; #local c43 = <0,c33.y, c33.z>; #local c44 = <0,c34.y, c34.z>; union { object{retalho(a11,a12,a13,a14,a21,a22,a23,a24,a31,a32,a33,a34,a41,a42,a43,a44,0.0001, tx_espelho, tx_bandeira)} object{retalho(b11,b12,b13,b14,b21,b22,b23,b24,b31,b32,b33,b34,b41,b42,b43,b44,0.0001, tx_espelho, tx_bandeira)} object{retalho(c11,c12,c13,c14,c21,c22,c23,c24,c31,c32,c33,c34,c41,c42,c43,c44,0.0001, tx_espelho, tx_bandeira)} object{retalho(a11,a12,a13,a14,a21,a22,a23,a24,a31,a32,a33,a34,a41,a42,a43,a44,0.0001, tx_espelho, tx_bandeira) scale <-1,1,1> } object{retalho(b11,b12,b13,b14,b21,b22,b23,b24,b31,b32,b33,b34,b41,b42,b43,b44,0.0001, tx_espelho, tx_bandeira) scale <-1,1,1>} object{retalho(c11,c12,c13,c14,c21,c22,c23,c24,c31,c32,c33,c34,c41,c42,c43,c44,0.0001, tx_espelho, tx_bandeira) scale <-1,1,1>} } #end #macro aviaodeformado(a22,a23,a32,a33,b22,b23,b32,b33,c22,c23,c32,c33,d1,d2) #local da22 = a22 + d1 * deform1(a22) + d2 * deform2(a22); #local da23 = a23 + d1 * deform1(a23) + d2 * deform2(a23); #local da32 = a32 + d1 * deform1(a32) + d2 * deform2(a32); #local da33 = a33 + d1 * deform1(a33) + d2 * deform2(a33); #local db22 = b22 + d1 * deform1(b22) + d2 * deform2(b22); #local db23 = b23 + d1 * deform1(b23) + d2 * deform2(b23); #local db32 = b32 + d1 * deform1(b32) + d2 * deform2(b32); #local db33 = b33 + d1 * deform1(b33) + d2 * deform2(b33); #local dc22 = c22 + d1 * deform1(c22) + d2 * deform2(c22); #local dc23 = c23 + d1 * deform1(c23) + d2 * deform2(c23); #local dc32 = c32 + d1 * deform1(c32) + d2 * deform2(c32); #local dc33 = c33 + d1 * deform1(c33) + d2 * deform2(c33); object{aviao(da22,da23,da32,da33,db22,db23,db32,db33,dc22,dc23,dc32,dc33)} #end object{ eixos(100.00) } object{aviaodeformado(a22,a23,a32,a33,b22,b23,b32,b33,c22,c23,c32,c33,ctt+2,stt+2)rotate <0,0,90> translate rotate <0,0,stt*90> } object{asa scale <20,1,0.1> translate<0,15,0> texture{ tx_plastico}rotate <0,0,90> translate rotate <0,0,stt*90> } object{asa scale <10,1,0.1> translate<0,32,0> texture{ tx_plastico}rotate <0,0,90> translate rotate <0,0,stt*90> } //object{predio texture{tx_fosca2}} //object{banner rotate -90*y scale<6,6,6> translate <4.1,0,16> } //object{bandeira translate<0,4,0>} //object{bandeira translate<0,-4,0>} //object{chassi(1,1,stt)} //object{coxas{1,1,1}} //object{chassi(0,0,0)} /*difference { union { object { bola } object { pino } } object { furo } rotate 360*tt*z translate -1.5*ctt*y }*/ #end // gera o quadro correspondente ao instante dado {clock}: quadro(clock)