// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2020-12-08 11:44:55 by jstolfi #version 3.6; // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_cinza = texture{ pigment{ color rgb < 0.60, 0.60, 0.60 > } finish{ diffuse 0.9 ambient 0.1 } } // ====================================================================== // DESCRIÇÃO DA CENA #macro interpola1(tt,tt0,tt1,vv0,vv1) #local rr = (tt-tt0)/(tt1-tt0); #local vv = (1-rr)*vv0 + rr*vv1; vv #end #macro interpola3(tt, tt0, tt3, vv0, vv1, vv2, vv3) #local vv01 = interpola1(tt, tt0,tt3, vv0,vv1); #local vv12 = interpola1(tt, tt0,tt3, vv1,vv2); #local vv23 = interpola1(tt, tt0,tt3, vv2,vv3); #local vv012 = interpola1(tt, tt0,tt3, vv01,vv12); #local vv123 = interpola1(tt, tt0,tt3, vv12,vv23); #local vv0123 = interpola1(tt, tt0,tt3, vv012,vv123); vv0123 #end #macro segmento(N, P0, P1, P2, P3, R0, R3) #local i = 0; union{ #while (i <= N) #local raio = interpola1(i/N, 0, 1, R0, R3); #local centro = ; #local i = i + 1; sphere {centro, raio texture { tx_cinza } } #end } #end #macro tentaculo(N, A0, A1, A2, B1, B2, C1, C2, C3, RA0, RC3) union{ #local A3 = <(A2.x+B1.x)/2, (A2.y+B1.y)/2, (A2.z+B1.z)/2>; #local RA3 = interpola1(1/3, 0, 1, RA0, RC3); segmento(N, A0, A1, A2, A3, RA0, RA3) #local B0 = A3; #local RB0 = RA3; #local RB3 = interpola1(2/3, 0, 1, RA0, RC3); #local B3 = <(B2.x+C1.x)/2, (B2.y+C1.y)/2, (B2.z+C1.z)/2>; segmento(N, B0, B1, B2, B3, RB0, RB3) #local RC0 = RB3; #local C0 = B3; segmento(N, C0, C1, C2, C3, RC0, RC3) } #end #macro tentaculo_aleatorio(N, smt, A0, C3, RA0, RC3) #local roleta = seed (smt); #local tam = vlength(C3-A0)/5; #local A1 = ; #local A2 = ; #local B1 = ; #local B2 = ; #local C1 = ; #local C2 = ; object {tentaculo(N, A0, A1, A2, B1, B2, C1, C2, C3, RA0, RC3)} #end #macro virus(N) union{ sphere {<0,0,0>, 3 texture { tx_cinza } } object {tentaculo_aleatorio(N, 13, <0,0,0>, <6,0,2>, 0.5, 0.08) translate <1,0,0>} object {tentaculo_aleatorio(N, 23, <0,0,0>, <6,0,-1>, 0.5, 0.08) rotate <0,90,0> translate <0,0,-2>} object {tentaculo_aleatorio(N, 33, <0,0,0>, <6,0,1>, 0.6, 0.03) rotate <0,-90,0> translate <0,0,2>} object {tentaculo_aleatorio(N, 43, <0,0,0>, <6,0,2>, 0.5, 0.02) rotate <0,0,90> translate <0,2,0>} object {tentaculo_aleatorio(N, 53, <0,0,0>, <6,-3,1>, 0.4, 0.08) rotate <0,0,-90> translate <0,-2,2> } object {tentaculo_aleatorio(N, 63, <0,0,0>, <6,-1,4>, 0.4, 0.01) rotate <60,0,90> translate <1,1,1> } } #end #include "eixos.inc" // Aqui está a cena, finalmente: union{ // object{ eixos(4.00) } virus(200) } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.50 >; #declare raio_cena = 12.0; #declare dir_camera = < 8.00, -14.00, 6.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)