// Last edited on DATE TIME by USER // Processed by remove-cam-lights background { color rgb < 1,1,1 > } #declare tx_vareta = texture { pigment { color rgb<0.4,0.4,0.4> filter 0.8 } finish { diffuse 0.01 } } #declare tx_retalho = texture { pigment { color rgb<1,0,0> } finish { diffuse 1 } } #include "retalho-simples.inc" #include "eixos.inc" #declare nx = 2; #declare ny = 3; #declare PP = array[nx][ny][4][4]; #for (i, 0, nx-1) #for (j, 0,ny-1) #for (a, 0,3) #for (b, 0,3) #declare PP[i][j][a][b] = ; #end #end #end #end #macro copiar_matriz(A,m,n) #local B = array[4][4]; #for (i, 0,3) #for (j, 0,3) #local B[i][j] = A[m][n][i][j]; #end #end B #end #macro emenda_retalho(pp, r0,s0, r1,s1) #for (i, 0,3) #local pp[r0][s0][i][3] = (pp[r0][s0][i][2] + pp[r1][s1][i][1])/2; #local pp[r1][s1][i][0] = pp[r0][s0][i][3]; #end #end #macro carroceria(pp, NX, NY) #for (i, 0,NX-1) #for (j, 0,NY-1) #if (i <= NX/2) #if (j = 0) #local pp[i][j][1][3] = <-0.5,1.5,3>; #end #if (j = 1) emenda_retalho(pp, i,j-1, i,j) #end #if (j = 2) emenda_retalho(pp, i,j-1, i,j) #end #local P = copiar_matriz(pp,i,j) object { retalho(P, 0.025, tx_vareta, tx_retalho) translate <3*i+1.5,3*j+1.5,1.5>} #else object { retalho(P, 0.025, tx_vareta, tx_retalho) scale -1 rotate x*180 translate <3*i+1.5,3*j+1.5,1.5> } #end #end #end #end object { eixos(8) } carroceria(PP, nx, ny) #include "camlight.inc" #declare centro_cena = < 3,5,3 >; #declare raio_cena = 8; #declare dir_camera = < 90, 10, 15 >; // 0, -1, 90 for XY #declare dist_camera = 4*raio_cena; #declare intens_luz = 1.4; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)