// Exemplo de arquivo de descricao de cena para POV-ray // Nome: Flávio Marcos Helder Moura RA:104947 // ====================================================================== // 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_plastico_2 = texture{ pigment{ color rgb < 0.70, 0.25, 0.75 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_monster = texture{ pigment{ color rgb < 0.80, 0.15, 0.95 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_tentaculo = texture{ pigment{ color rgb < 0.80, 0.15, 0.55 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_olho = texture{ pigment{ color rgb < 0.00, 0.00, 0.80 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRIÇÃO DA CENA #declare i = 0; #declare p0 = <0, 0, 0>; #declare p1 = <20, 40, 15>; #declare p2 = <10, 20, 50>; #declare p3 = <50, 50, 50>; #declare r0 = 8; #declare r1 = 5; #declare r2 = 3; #declare r3 = 1; #declare roleta = seed(666); #macro interpola_1(tt, tt0, vv0, tt1, vv1) #local ss = (tt - tt0)/(tt1 - tt0); (vv0 + ss*(vv1 - vv0)) #end #macro gera_segmento_1(m, p0, r0, p1, r1) #declare i = 0; union{ #while(i < m) #declare posicao = interpola_1(i, 0, p0, m, p1); #declare raio = interpola_1(i, 0, r0, m, r1); sphere{ posicao, raio } #declare i = i + 1; #end } #end #macro interpola_3(tt, t0, t1, A, B, C, D) #local AB = interpola_1(tt, t0, A, t1, B); #local BC = interpola_1(tt, t0, B, t1, C); #local CD = interpola_1(tt, t0, C, t1, D); #local ABC = interpola_1(tt, t0, AB, t1, BC); #local BCD = interpola_1(tt, t0, BC, t1, CD); #local ABCD = interpola_1(tt, t0, ABC, t1, BCD); ABCD #end #macro gera_segmento_3(m, p0, r0, p1, r1, p2, r2, p3, r3) #declare i = 1; union{ #while(i <= m) #declare posicao = interpola_3(i, 0, m, p0, p1, p2, p3); #declare raio = interpola_3(i, 0, m, r0, r1, r2, r3); sphere{ posicao, raio } #declare i = i + 1; #end } #end //#macro define_tentaculo_3(n, PA, RA, PB, RB, PC, RC, PD, RD) //#declare i = 0; //#while(i < n) //PB[i] = //PC[i] = //#declare i = i + 1; //#end //PA[0] = //PD[n-1] = //#end //#macro gera_tentaculo_3(dt, n, PA, RA, PB, RB, PC, RC, PD, RD) //#local PA = array[n]; //#local PB = array[n]; //#local PC = array[n]; //#local PD = array[n]; //define_tentaculo_3() //#end //#macro gera_monstro(n) //union{ //box{ <0, 0, 0>, <-20, 20, 40> texture{tx_monster}} //sphere{ <-10, 10, 50>, 20 texture{tx_monster}} //sphere{ <0, 4, 60>, 8 texture{tx_olho}} //sphere{ <0, 16, 60>, 8 texture{tx_olho}} //sphere{ <-10, 10, 94>, 8 texture{tx_monster}} //cylinder{ <-10, 10, 70>, <-10, 10, 90>, 3 texture{tx_monster}} //object{ gera_segmento_3(n, p0, r0, p1, r1, p2, r2, p3, r3) texture{tx_tentaculo}} //} //#end #include "eixos.inc" // Aqui está a cena, finalmente: //object{ gera_monstro(20) } object{ gera_segmento_3(20, p0, r0, p1, r1, p2, r2, p3, r3) texture{tx_tentaculo}} #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 150.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 150.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)