// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2017-05-07 20:10:09 by stolfilocal // ssh ra217638@ssh2.students.ic.unicamp.br // scp main.pov main.png ra217638@ssh2.students.ic.unicamp.br:/home/ec2018-fra/ra217638/public_html/mc937-2020-2 // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 0.30, 0.30, 0.30 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_vermelho = texture{ pigment{ color rgb < 1.00, 0.00, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_verde = texture { pigment{ color rgb < 0.00, 1.00, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } } // Defines // ====================================================================== // Macros #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) union { sphere { , R0 } #local i = 0; #while (i <= N) #local tt = i/N; #local R = interpola1(tt,0,1,R0,R3); #local P = interpola3(tt,0,1,P0,P1,P2,P3); sphere { , R } #local i = i+1; #end sphere { , R3 } } #end #macro tentaculo(N, A0,A1,A2,B1,B2,C1,C2,C3, RA0,RC3) #local A3 = (A2 + B1)/2; #local B0 = (A2 + B1)/2; #local B3 = (B2 + C1)/2; #local C0 = (B2 + C1)/2; #local RA3 = interpola1(1/3,0,1,RA0,RC3); #local RB0 = interpola1(1/3,0,1,RA0,RC3); #local RB3 = interpola1(2/3,0,1,RA0,RC3); #local RC0 = interpola1(2/3,0,1,RA0,RC3); object{segmento(N, A0,A1,A2,A3, RA0,RA3) texture {tx_vermelho}} object{segmento(N, B0,B1,B2,B3, RB0,RB3) texture {tx_vermelho}} object{segmento(N, C0,C1,C2,C3, RC0,RC3) texture {tx_vermelho}} #end #macro tentaculo_aleatorio(N,smt,A0,C3,RA0,RC3) #declare roleta = seed(smt); #local s = 6; #local A1 = interpola1(1/9,0,1,A0,C3); #local A1p = ; #local A1 = A1 + A1p*s; #local A2 = interpola1(2/9,0,1,A0,C3); #local A2p = ; #local A2 = A2 + A2p*s; #local B1 = interpola1(4/9,0,1,A0,C3); #local B1p = ; #local B1 = B1 + B1p*s; #local B2 = interpola1(5/9,0,1,A0,C3); #local B2p = ; #local B2 = B2 + B2p*s; #local C1 = interpola1(7/9,0,1,A0,C3); #local C1p = ; #local C1 = C1 + C1p*s; #local C2 = interpola1(8/9,0,1,A0,C3); #local C2p = ; #local C2 = C2 + C2p*s; tentaculo(N, A0,A1,A2,B1,B2,C1,C2,C3, RA0,RC3) #end // ====================================================================== // DESCRI��O DA CENA // Partes da cenaS: #include "eixos.inc" // Aqui est� a cena, finalmente: union{ object{ eixos(3.00) } sphere { <0, 0, 0>, 5 texture { tx_vermelho } } #local A01 = <5.5,0,0>; #local C31 = <20,-2,3>; #local A02 = <-5.5,0,0>; #local C32 = <-17,5,-1>; #local A03 = <0,5.5,0>; #local C33 = <3,22,-3>; #local A04 = <0,-5.5,0>; #local C34 = <3,-26,7>; #local A05 = <0,0,5.5>; #local C35 = <3,7,21>; #local A06 = <0,0,-5.5>; #local C36 = <-3,2,-18>; tentaculo_aleatorio(150,5,A01,C31,1,0.1) tentaculo_aleatorio(150,2,A02,C32,1,0.1) tentaculo_aleatorio(150,7,A03,C33,1,0.1) tentaculo_aleatorio(150,3,A04,C34,1,0.1) tentaculo_aleatorio(150,3,A05,C35,1,0.1) tentaculo_aleatorio(150,3,A06,C36,1,0.1) } #include "camlight.inc" #declare centro_cena = < 2.00, 2.00, 2.00 >; #declare raio_cena = 30.0; #declare dir_camera = < 1.00, 1.00, 1.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)