// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2010-03-04 15:44:01 by stolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico1 = 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_plastico2 = texture{ pigment{ color rgb < 1.00, 0.10, 0.10 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 1.00, 1.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.25, 0.50 > } 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?AO DA CENA // Partes da cena: #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) #local i = 0; union{ #while(i < m) #declare vv = interpola_1(i/m, 0, p0, 1, p1); sphere{vv, i/m texture{ tx_fosca}} #local 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,pA,rA,pB,rB,pC,rC,pD,rD) //gera um seg de tentaculo curvo //cujo eixo eh a curva de Bezier pA,pB,pC,pD //e cujo raio varia segundo o polinomio //de Bezier rA,rB,rC,rD #local i = 0; union{ #while(i < m) #declare ABCD = interpola_3(i/m, 0, 1, pA,pB,pC,pD); sphere{ABCD, i/m texture{ tx_fosca}} #local i = i + 1; #end } #end #macro define_tentaculo(n,pA,rA,pB,rB,pC,rC,pD,rD) //gera um seg de tentaculo curvo //cujo eixo eh a curva de Bezier pA,pB,pC,pD //e cujo raio varia segundo o polinomio //de Bezier rA,rB,rC,rD #local i = 0; union{ #while(i < m) pB[i] = <0,2,10>; rB[i] = rand(483); #local i = i + 1; #end } #end #include "eixos.inc" #declare p0 = <0,0,0>; #declare p1 = <0,10,5>; #declare pA = <2,0,0>; #declare pB = <0,2,10>; #declare pC = <0,4,2>; #declare pD = <0,6,5>; #declare n = 4; #declare PA = array[n]; #declare PB = array[n]; #declare PC = array[n]; #declare PD = array[n]; union{ //object{gera_segmento_1(100,p0,5,p1,10) texture{tx_plastico1}} object{gera_segmento_3(100,pA,1,pB,2,pC,4,pD,8) texture{tx_plastico1}} //object{define_tentaculo(n,PA,PB,PC,PD) texture{tx_plastico1}} } #include "camlight.inc" #declare centro_cena = < 2.00, 2.00, 2.00 >; #declare raio_cena = 15.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 20.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)