// Last edited on DATE TIME by USER // Processed by remove-cam-lights #macro quadro(tt) #include "eixos.inc" #include "retalho.inc" #include "camlight.inc" #declare centro_cena = < 0.00, 40.00, 0.00 >; #declare raio_cena = 100; #declare dir_camera = < 1.0, 0, 0 >; #declare dist_camera = 100.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz) 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; #declare ctt = cos(4*pi*tt); #declare stt = sin(4*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 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>} scale <1, -1, 1> } #end #macro deform1(p) #local cons = 2*sin(pi+p.y/18); <5*cons, 0, 0> #end #macro deform2(p) #local cons = 2*sin(pi+p.y/18); <0, 0, 5*cons> #end #macro interpola2(tA, A, tB, B, tt) #local r = (tt - tA) / (tB - tA); ((1 - r) * A + r * B) #end #macro interpola4(tA, A, B, C, D, tD, tt) #local AB = interpola2(tA, A, tD, B, tt); #local BC = interpola2(tA, B, tD, C, tt); #local CD = interpola2(tA, C, tD, D, tt); #local ABC = interpola2(tA, AB, tD, BC, tt); #local BCD = interpola2(tA, BC, tD, CD, tt); #local ABCD = interpola2(tA, ABC, tD, BCD, tt); ABCD #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); #local mul = 10.0; #local B = mul*<0, 0, 2>; #local C = mul*<0, 1, 5>; #local F = mul*<0, 2, 3>; #local G = mul*<0, 3, 4>; #local J = mul*<0, 5, 0>; #local K = mul*<0, 4, -3>; #local N = mul*<0, 3, -4>; #local O = mul*<0, 2, -1>; #local A = (B + O) / 2.0; #local P = A; #local D = (C + F) / 2.0; #local E = D; #local H = (G + J) / 2.0; #local I = H; #local L = (K + N) / 2.0; #local M = L; #if ((clock >= 0) & (clock < 0.25)) #local pos = interpola4(0, A, B, C, D, 0.25, clock); #local p2 = interpola4(0, A, B, C, D, 0.25, clock+0.001); #local vv = p2 - pos; #local a = degrees(atan2(vv.y, vv.z)); #end #if ((clock >= 0.25) & (clock < 0.50)) #local pos = interpola4(0.25, E, F, G, H, 0.50, clock); #local p2 = interpola4(0.25, E, F, G, H, 0.50, clock+0.001); #local vv = p2 - pos; #local a = degrees(atan2(vv.y, vv.z)); #end #if ((clock >= 0.50) & (clock < 0.75)) #local pos = interpola4(0.50, I, J, K, L, 0.75, clock); #local p2 = interpola4(0.50, I, J, K, L, 0.75, clock+0.001); #local vv = p2 - pos; #local a = degrees(atan2(vv.y, vv.z)); #end #if (clock >= 0.75) #local pos = interpola4(0.75, M, N, O, P, 1.00, clock); #local p2 = interpola4(0.75, M, N, O, P, 1.00, clock+0.001); #local vv = p2 - pos; #local a = degrees(atan2(vv.y, vv.z)); #end #warning concat("pos = ", str(pos.x, 8, 6), " ", str(pos.y, 8, 6), " ", str(pos.z, 8, 6), "\n") object{aviao(da22,da23,da32,da33,db22,db23,db32,db33,dc22,dc23,dc32,dc33) translate pos rotate <-a, 0, 0>} #end object{ eixos(100.00) } object{aviaodeformado(a22,a23,a32,a33,b22,b23,b32,b33,c22,c23,c32,c33, 0, 0) } #end quadro(clock)