// Last edited on DATE TIME by USER
// Processed by remove-cam-lights
#include "textures.inc"
#include "eixos.inc"
#include "colors.inc"
#include "retalho.inc"
background{ color White }
#declare chassi =
union{
object{box{<0,0,0>, <4,7,2>} pigment {color Red} }
object{box{<0,2,2>, <4,7,3.5>} pigment {color Green}}
}
#macro interpole(ta, va, tb, vb, tt)
#local s = (tt-ta)/(tb-ta);
((1-s)*va+s*vb)
#end
#macro projecao(A)
(<0, A.y, A.z>)
#end
#macro deforma(p, d1)
#local cons = -0.5+sin(pi*p.y);
#if(p.y < 8)
#local pd =
;
#else
#local pd = <0, -3 + p.y*0.5, p.z *(1 + cons)>;
#end
(p + pd*d1)
#end
#macro deforma2(p, d2)
#local cons = sin(pi*p.y/4);
#local pd = ;
(p + pd*d2)
#end
#macro lataria(
A01, A02,
A11, A12, A21, A22,
B11, B12, B21, B22,
C11, C12, C21, C22,
C31, C32
)
#local A00 = projecao(A01);//<0,0,0.75>;
#local A03 = projecao(A02);//<0,0,3>;
#local A10 = projecao(A11); //<0,2,0.25>;
#local A13 = projecao(A12); //<0,2,3.75>;
#local A20 = projecao(A21);//<0,4,0>;
#local A23 = projecao(A22);//<0,4,6>;
#local B10 = projecao(B11);//<0,8,0>;
#local B13 = projecao(B12);//<0,8,6.5>;
#local B20 = projecao(B21);//<0,10,0.25>;
#local B23 = projecao(B22);//<0,10,5.4>;
#local C10 = projecao(C11);//<0,14,0.25>;
#local C13 = projecao(C12);//<0,14,4>;
#local C20 = projecao(C21);//<0,15,0>;
#local C23 = projecao(C22);//<0,15,5.4>;
#local C30 = projecao(C31);//<0,16,0>;
#local C33 = projecao(C32);//<0,16,5.4>;
#local AB0 = (A20+B10)/2;
#local AB1 = (A21+B11)/2;
#local AB2 = (A22+B12)/2;
#local AB3 = (A23+B13)/2;
#local BC0 = (B20+C10)/2;
#local BC1 = (B21+C11)/2;
#local BC2 = (B22+C12)/2;
#local BC3 = (B23+C13)/2;
#local rg = 0.01;
union{
object{
retalho(
A00,A01,A02,A03,
A10,A11,A12,A13,
A20,A21,A22,A23,
AB0,AB1,AB2,AB3,
rg,
pigment{color Blue}, pigment{ color Red }
)
}
object{
retalho(
AB0,AB1,AB2,AB3,
B10,B11,B12,B13,
B20,B21,B22,B23,
BC0,BC1,BC2,BC3,
rg,
pigment{color Blue}, pigment{ color Green }
)
}
object{
retalho(
BC0,BC1,BC2,BC3,
C10,C11,C12,C13,
C20,C21,C22,C23,
C30,C31,C32,C33,
rg,
pigment{color Blue}, pigment{ color Blue }
)
}
}
#end
#declare A01 = <3,0,0.75>;
#declare A02 = <3,0,3>;
#declare A11 = <3,2,0.25>;
#declare A12 = <3,2,3.75>;
#declare A21 = <3,4,0>;
#declare A22 = <3,4,6>;
#declare B21 = <3,10,0.25>;
#declare B22 = <3,10,5.4>;
#declare B11 = <3,8,0>;
#declare B12 = <3,8,6.5>;
#declare C11 = <3,14,0.25>;
#declare C12 = <3,14,4>;
#declare C21 = <3,15,0>;
#declare C22 = <3,15,5.4>;
#declare C31 = <3,16,0>;
#declare C32 = <3,16,5.4>;
#macro lataria_deformada(d1, d2)
#local Ad01 = deforma(A01,d1); //+ deforma2(A01,d2);
#local Ad02 = deforma(A02,d1); //+ deforma2(A02,d2);
#local Ad11 = deforma(A11,d1); //+ deforma2(A11,d2);
#local Ad12 = deforma(A12,d1); //+ deforma2(A12,d2);
#local Ad21 = deforma(A21,d1); //+ deforma2(A21,d2);
#local Ad22 = deforma(A22,d1); //+ deforma2(A22,d2);
#local Cd11 = deforma(C11,d1); //+ deforma2(C11,d2);
#local Cd12 = deforma(C12,d1); //+ deforma2(C12,d2);
#local Cd21 = deforma(C21,d1); //+ deforma2(C21,d2);
#local Cd22 = deforma(C22,d1); //+ deforma2(C22,d2);
#local Cd31 = deforma(C31,d1); //+ deforma2(C31,d2);
#local Cd32 = deforma(C32,d1); //+ deforma2(C32,d2);
lataria(
Ad01, Ad02,
Ad11, Ad12, Ad21, Ad22,
B11, B12, B21, B22,
Cd11, Cd12, Cd21, Cd22,
Cd31, Cd32
)
#end
#macro lado(d1,d2)
union{
object{
lataria_deformada(d1,d2)
}
object{
box { <0,0,0>, <6,5,0.5> }
rotate 15*d1*x
translate <1.5,5,3>
pigment{ color Gray }
}
}
#end
#macro aviao(d1, d2)
union{
object{lado(d1,d2)}
object{lado(d1,d2) scale <-1,1,1>}
}
#end
#declare c = sin(clock * pi);
union{
eixos(10)
object{ aviao(c,0) translate <0,0,5>}
}
#include "camlight.inc"
#declare centro_cena = < 0.00, 6.00, 0.00 >;
#declare raio_cena = 30.0;
#declare dir_camera = < 5, -3, 2 >;
#declare dist_camera = 30.0;
#declare intens_luz = 1.00;
camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)