#declare tx_grade =
texture {
pigment { color rgb < 1.00, 0.80, 0.10 > }
finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
}
#declare tx_corpo =
texture {
pigment { color rgb < 0.3, 0.80, 0.90 > }
finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
}
#declare tx_ponta =
texture {
pigment { color rgb < 0.30, 0.80, 0.20 >}
finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
}
#declare tx_asa =
texture {
pigment { color rgb < 0.70, 0.40, 0.10 >}
finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
}
#declare asa =
box{
< -20, 8, 1.5 >,
< 20, 11, 1.8 >
texture {tx_asa}
}
#include "retalho.inc"
#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
#declare A = <0,0,0>;
#declare B = <0,20,-20>;
#declare D = <0,60,-20>;
#declare E = <0,80,0>;
#declare G = <0,80,40>;
#declare H = <0,60,60>;
#declare J = <0,20,60>;
#declare K = <0,0,40>;
#declare C = (B+D)/2;
#declare F = (E+G)/2;
#declare I = (H+J)/2;
#declare L = (K+A)/2;
#declare a22 = < -3, 1, 5 >;
#declare a23 = < -3, 19, 5 >;
#declare a32 = < -3, 1, 1 >;
#declare a33 = < -3, 19, 1 >;
#declare b22 = < -0.8, -1, 5 >;
#declare b23 = < -0.3, -2, 5 >;
#declare b24 = < 0, -3, 5 >;
#declare b14 = b24;
#declare b32 = < -0.8, -1, 1 >;
#declare b33 = < -0.3, -2, 1 >;
#declare b34 = < 0, -3, 1 >;
#declare b44 = b34;
#declare c22 = < -0.8, 21, 5 >;
#declare c23 = < -0.3, 22, 5 >;
#declare c24 = < 0, 23, 5 >;
#declare c14 = c24;
#declare c32 = < -0.8, 21, 1 >;
#declare c33 = < -0.3, 22, 1 >;
#declare c34 = < 0, 23, 1 >;
#declare c44 = c34;
#macro engorda(p)
#end
#macro emagrece(p)
#end
#macro aviao(a22,a23,a32,a33,b22,b23,b24,b14,b32,b33,b34,b44,c22,c23,c24,c14,c32,c33,c34,c44)
#local a12 = < 0, a22.y, a22.z >;
#local a13 = < 0, a23.y, a23.z >;
#local a42 = < 0, a32.y, a32.z >;
#local a43 = < 0, a33.y, a33.z >;
#local b12 = < 0, b22.y, b22.z >;
#local b13 = < 0, b23.y, b23.z >;
#local b42 = < 0, b32.y, b32.z >;
#local b43 = < 0, b33.y, b33.z >;
#local c12 = < 0, c22.y, c22.z >;
#local c13 = < 0, c23.y, c23.z >;
#local c42 = < 0, c32.y, c32.z >;
#local c43 = < 0, c33.y, c33.z >;
#local a11 = (b12+a12)/2;
#local a21 = (b22+a22)/2;
#local a31 = (b32+a32)/2;
#local a41 = (b42+a42)/2;
#local a14 = (a13+c12)/2;
#local a24 = (a23+c22)/2;
#local a34 = (a33+c32)/2;
#local a44 = (a43+c42)/2;
union {
object {
retalho(a11,a12,a13,a14,a21,a22,a23,a24,a31,a32,a33,a34,a41,a42,a43,a44, 0.1, tx_grade, tx_corpo)
}
object {
retalho(a11,b12,b13,b14,a21,b22,b23,b24,a31,b32,b33,b34,a41,b42,b43,b44, 0.1, tx_grade, tx_ponta)
}
object {
retalho(a14,c12,c13,c14,a24,c22,c23,c24,a34,c32,c33,c34,a44,c42,c43,c44, 0.1, tx_grade, tx_ponta)
}
}
#end
#macro aviao_deformado(a22,a23,a32,a33,b22,b23,b24,b14,b32,b33,b34,b44,c22,c23,c24,c14,c32,c33,c34,c44, d1, d2)
#local da22 = a22+(engorda(a22)*d1);
#local da23 = a23+(emagrece(a23)*d2);
#local da32 = a32+(engorda(a32)*d1);
#local da33 = a33+(emagrece(a33)*d2);
aviao(da22,da23,da32,da33,b22,b23,b24,b14,b32,b33,b34,b44,c22,c23,c24,c14,c32,c33,c34,c44)
#end
#macro aviao_final ()
union {
object{ eixos(3.00) }
object{aviao_deformado(a22,a23,a32,a33,b22,b23,b24,b14,b32,b33,b34,b44,c22,c23,c24,c14,c32,c33,c34,c44, 1, 1.8) scale <-1,1,1>}
object{aviao_deformado(a22,a23,a32,a33,b22,b23,b24,b14,b32,b33,b34,b44,c22,c23,c24,c14,c32,c33,c34,c44, 1, 1.8)}
object{asa translate <0, 0, 1.5>}
}
#end
background{ color rgb < 1, 1, 1 > }
#include "eixos.inc"
#if (clock <= 0.25)
object {
aviao_final() translate interpola4(0, L, A, B, C, 0.25, clock) rotate interpola4(0, -90, -60, -30, 0, 0.25, clock)*x
rotate interpola4(0, -90, -60, -30, 0, 0.25, clock)*y rotate interpola4(0, -90, -60, -30, 0, 0.25, clock)*z
}
#end
#if (clock > 0.25 & clock <= 0.5)
object {
aviao_final() translate interpola4(0.25, C, D, E, F, 0.5, clock) rotate interpola4(0.25, 0, 30, 60, 90, 0.5, clock)*x
rotate interpola4(0.25, 0, 30, 60, 90, 0.5, clock)*y rotate interpola4(0.25, 0, 30, 60, 90, 0.5, clock)*z
}
#end
#if (clock > 0.5 & clock <= 0.75)
object {
aviao_final() translate interpola4(0.5, F, G, H, I, 0.75, clock) rotate interpola4(0.5, 90, 120, 150, 180, 0.75, clock)*x
rotate interpola4(0.5, 90, 120, 150, 180, 0.75, clock)*y rotate interpola4(0.5, 90, 120, 150, 180, 0.75, clock)*z
}
#end
#if (clock > 0.75)
object {
aviao_final() translate interpola4(0.75, I, J, K, L, 1, clock) rotate interpola4(0.75, 180, 210, 240, 270, 1, clock)*x
rotate interpola4(0.75, 180, 210, 240, 270, 1, clock)*y rotate interpola4(0.75, 180, 210, 240, 270, 1, clock)*z
}
#end
//Posicionamento da camera
#include "camlight.inc"
#declare centro_cena = <100.00, 100.00, 50.00>;
#declare raio_cena = 50.0;
#declare dir_camera = < 5, 5, 4 >;
#declare dist_camera = 50.0;
#declare intens_luz = 1.50;
camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)