// Last edited on 2021-02-03 15:15:41 by jstolfi #version 3.6; global_settings{ max_trace_level 30 } background{ color rgb < 0.850, 0.850, 0.850 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.100, 0.800, 1.000 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_plastico_y = texture{ pigment{ color rgb < 1.000, 0.800, 0.100 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_plastico_g = texture{ pigment{ color rgb < 0.100, 1.000, 0.800 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_lata = texture{ pigment{ color rgb < 0.100, 1.000, 0.800 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fixa = texture{ pigment{ color rgb < 0.000, 0.800, 0.100 > } finish{ diffuse 0.0 ambient 1.0 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.600, 0.600, 0.600 >, color rgb < 0.900, 0.900, 0.900 > } finish{ diffuse 0.9 ambient 0.1 } scale 0.5 } #local tx_vidro = texture{ pigment{ color rgb < 1,1,1 > filter 0.960 } finish{ diffuse 0.005 ambient 0.005 reflection 0.030 * < 1,0,0 > specular 0.35 roughness 0.005 } } #include "eixos.inc" #include "retalho-simples.inc" #local A = array[4][4] #local A[0][0] = < -6, 0, 0 >; #local A[0][1] = < -6, 1, 0 >; #local A[0][2] = < -6, 2, 0.1 >; #local A[0][3] = < -6, 3, 0.3 >; #local A[1][0] = < -5, 0, 0 >; #local A[1][1] = < -5, 1, 0.6 >; #local A[1][2] = < -5, 2, 0.8 >; #local A[1][3] = < -5, 3, 0 >; #local A[2][0] = < -4, 0, 0 >; #local A[2][1] = < -4, 1, 0.7 >; #local A[2][2] = < -4, 2, 1 >; #local A[2][3] = < -4, 3, 0 >; #local A[3][0] = < -3, 0, 0 >; #local A[3][1] = < -3, 1, 0 >; #local A[3][2] = < -3, 2, 0.5 >; #local A[3][3] = < -3, 3, 0 >; #local B = array[4][4] #local B[0][0] = < -6, 3, 0 >; #local B[0][1] = < -6, 4, 0 >; #local B[0][2] = < -6, 5, 0.1 >; #local B[0][3] = < -6, 6, 0.3 >; #local B[1][0] = < -5, 3, 0 >; #local B[1][1] = < -5, 4, 0.6 >; #local B[1][2] = < -5, 5, 0.8 >; #local B[1][3] = < -5, 6, 0 >; #local B[2][0] = < -4, 3, 0 >; #local B[2][1] = < -4, 4, 0.7 >; #local B[2][2] = < -4, 5, 1 >; #local B[2][3] = < -4, 6, 0 >; #local B[3][0] = < -3, 3, 0 >; #local B[3][1] = < -3, 4, 0 >; #local B[3][2] = < -3, 5, 0.5 >; #local B[3][3] = < -3, 6, 0 >; #local C = array[4][4] #local C[0][0] = < -6, 6, 0 >; #local C[0][1] = < -6, 7, 0 >; #local C[0][2] = < -6, 8, 0.1 >; #local C[0][3] = < -6, 9, 0.3 >; #local C[1][0] = < -5, 6, 0 >; #local C[1][1] = < -5, 7, 0.6 >; #local C[1][2] = < -5, 8, 0.8 >; #local C[1][3] = < -5, 9, 0 >; #local C[2][0] = < -4, 6, 0 >; #local C[2][1] = < -4, 7, 0.7 >; #local C[2][2] = < -4, 8, 1 >; #local C[2][3] = < -4, 9, 0 >; #local C[3][0] = < -3, 6, 0 >; #local C[3][1] = < -3, 7, 0 >; #local C[3][2] = < -3, 8, 0.5 >; #local C[3][3] = < -3, 9, 0 >; #local D = array[4][4] #local D[0][0] = < -3, 0, 0 >; #local D[0][1] = < -3, 1, 0 >; #local D[0][2] = < -3, 2, 0.1 >; #local D[0][3] = < -3, 3, 0.3 >; #local D[1][0] = < -2, 0, 0 >; #local D[1][1] = < -2, 1, 0.6 >; #local D[1][2] = < -2, 2, 0.8 >; #local D[1][3] = < -2, 3, 0 >; #local D[2][0] = < -1, 0, 0 >; #local D[2][1] = < -1, 1, 0.7 >; #local D[2][2] = < -1, 2, 1 >; #local D[2][3] = < -1, 3, 0 >; #local D[3][0] = < 0, 0, 0 >; #local D[3][1] = < 0, 1, 0 >; #local D[3][2] = < 0, 2, 0.5 >; #local D[3][3] = < 0, 3, 0 >; #local E = array[4][4] #local E[0][0] = < -3, 3, 0 >; #local E[0][1] = < -3, 4, 0 >; #local E[0][2] = < -3, 5, 0.1 >; #local E[0][3] = < -3, 6, 0.3 >; #local E[1][0] = < -2, 3, 0 >; #local E[1][1] = < -2, 4, 0.6 >; #local E[1][2] = < -2, 5, 0.8 >; #local E[1][3] = < -2, 6, 0 >; #local E[2][0] = < -1, 3, 0 >; #local E[2][1] = < -1, 4, 0.7 >; #local E[2][2] = < -1, 5, 1 >; #local E[2][3] = < -1, 6, 0 >; #local E[3][0] = < 0, 3, 0 >; #local E[3][1] = < 0, 4, 0 >; #local E[3][2] = < 0, 5, 0.5 >; #local E[3][3] = < 0, 6, 0 >; #local F = array[4][4] #local F[0][0] = < -3, 6, 0 >; #local F[0][1] = < -3, 7, 0 >; #local F[0][2] = < -3, 8, 0.1 >; #local F[0][3] = < -3, 9, 0.3 >; #local F[1][0] = < -2, 6, 0 >; #local F[1][1] = < -2, 7, 0.6 >; #local F[1][2] = < -2, 8, 0.8 >; #local F[1][3] = < -2, 9, 0 >; #local F[2][0] = < -1, 6, 0 >; #local F[2][1] = < -1, 7, 0.7 >; #local F[2][2] = < -1, 8, 1 >; #local F[2][3] = < -1, 9, 0 >; #local F[3][0] = < 0, 6, 0 >; #local F[3][1] = < 0, 7, 0 >; #local F[3][2] = < 0, 8, 0.5 >; #local F[3][3] = < 0, 9, 0 >; // bind retalho boundaries //// left with right #macro retalho_bind_l2r(rleft, rright) #local rleft[0][3] = (rright[0][1] + rleft[0][2])/2; #local rright[2][0] = rleft[0][3]; #local rleft[1][3] = (rright[1][1] + rleft[1][2])/2; #local rright[1][0] = rleft[1][3]; #local rleft[2][3] = (rright[2][1] + rleft[2][2])/2; #local rright[2][0] = rleft[2][3]; #local rleft[3][3] = (rright[3][1] + rleft[3][2])/2; #local rright[3][0] = rleft[3][3]; #end retalho_bind_l2r(A, B) retalho_bind_l2r(B, C) retalho_bind_l2r(D, E) retalho_bind_l2r(E, F) //// top and bottom #macro retalho_bind_t2b(rtop, rbottom) #local rtop[3][0] = (rbottom[1][0] + rtop[2][0])/2; #local rbottom[0][0] = rtop[3][0]; #local rtop[3][1] = (rbottom[1][1] + rtop[2][1])/2; #local rbottom[0][1] = rtop[3][1]; #local rtop[3][2] = (rbottom[1][2] + rtop[2][2])/2; #local rbottom[0][2] = rtop[3][2]; #local rtop[3][3] = (rbottom[1][3] + rtop[2][3])/2; #local rbottom[0][3] = rtop[3][3]; #end retalho_bind_t2b(A, D) retalho_bind_t2b(B, E) retalho_bind_t2b(C, F) #local cena = union{ object{ eixos(5.0) } box{ < -80, -80, -0.1 >, < +80, +80, 00.0 > translate -2*z texture{ tx_xadrez } } object{ retalho(A, 0.02, tx_plastico_g, tx_plastico_g) } object{ retalho(B, 0.02, tx_plastico, tx_plastico) } object{ retalho(C, 0.02, tx_plastico_y, tx_plastico_y) } object{ retalho(D, 0.02, tx_plastico, tx_plastico) } object{ retalho(E, 0.02, tx_plastico_y, tx_plastico_y) } object{ retalho(F, 0.02, tx_plastico_g, tx_plastico_g) } } object{ cena } #include "camlight.inc" #declare centro_cena = < -1.5, 3.5, 0.0 >; #declare raio_cena = 5.0; #declare dir_camera = < 10.00, -5.00, 7.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera, z, intens_luz)