// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2017-05-07 20:10:09 by stolfilocal // ====================================================================== // CORES E TEXTURAS background { color rgb < 0.74, 0.84, 0.92 > } #declare roleta = seed(11031997); #declare tx_azul = texture { pigment { color rgb <0.34, 0.45, 0.6> } finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_vermelho = texture { pigment { color rgb <1, 0.37, 0.34> } finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_laranja = texture { pigment { color rgb <0.96, 0.55, 0.26> } finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_verde = texture { pigment { color rgb <0.34, 0.6, 0.45> } finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #macro interpolalin (t0, v0, t1, v1, tt) #local r = (tt - t0) / (t1 - t0); #local s = 1 - r; #local vv = s * v0 + r * v1; vv #end #macro arcobezier (t0, t1, A, B, C, D, tt) #local AB = interpolalin(t0, A, t1, B, tt); #local BC = interpolalin(t0, B, t1, C, tt); #local CD = interpolalin(t0, C, t1, D, tt); #local ABC = interpolalin(t0, AB, t1, BC, tt); #local BCD = interpolalin(t0, BC, t1, CD, tt); #local ABCD = interpolalin(t0, ABC, t1, BCD, tt); ABCD #end #macro quadrado (R, N) #declare tamanho = 10; #declare l = tamanho / 2; union{ #declare tt = 0; #while (tt < 1) /* #if (tt < 0.25) sphere{ interpolalin(0.00, <-l, -l, 0>, 0.25, <+l, -l, 0>, tt), R texture {tx_azul} } #elseif (tt < 0.50) sphere{ interpolalin(0.25, <+l, -l, 0>, 0.50, <+l, +l, 0>, tt), R texture {tx_vermelho}} #elseif (tt < 0.75) sphere{ interpolalin(0.50, <+l, +l, 0>, 0.75, <-l, +l, 0>, tt), R texture {tx_laranja}} #else sphere{ interpolalin(0.75, <-l, +l, 0>, 1.00, <-l, -l, 0>, tt), R texture {tx_verde}} #end */ sphere{ interpolalin(0, <-l, -l, 0>, 1, <+l, -l, 0>, tt), R texture {tx_azul} } sphere{ interpolalin(0, <+l, -l, 0>, 1, <+l, +l, 0>, tt), R texture {tx_vermelho}} sphere{ interpolalin(0, <+l, +l, 0>, 1, <-l, +l, 0>, tt), R texture {tx_laranja}} sphere{ interpolalin(0, <-l, +l, 0>, 1, <-l, -l, 0>, tt), R texture {tx_verde}} #declare tt = tt + (1 / N); #end } #end #macro curvaloca(R, N) #declare tamanho = 10; #declare l = tamanho / 2; union{ #declare tt = 0; #while (tt < 1) sphere{ arcobezier(0, 1, <2, -6, -5>, <-10, 30, 0>, <30, -10, 0>, <-6, 2, 5>, tt), R texture {tx_azul} } sphere{ arcobezier(0, 1, <2, -6, -5>, <10, -30, 0>, <-30, 10, 0>, <-6, 2, 5>, tt), R texture {tx_verde} } /* sphere{ arcobezier(0, 1, <-6, 2, 5>, <-10, 30, 0>, <30, -10, 0>, <2, -6, -5>, tt), R texture {tx_verde} } */ /* sphere{ interpolalin(0, <2, -6, 0>, 1, <-10, 30, 0>, tt), R texture {tx_verde} } sphere{ interpolalin(0, <-10, 30, 0>, 1, <30, -10, 0>, tt), R texture {tx_vermelho}} sphere{ interpolalin(0, <30, -10, 0>, 1, <-6, 2, 0>, tt), R texture {tx_laranja}} */ /* sphere{ arcobezier(0, 1, <+l, -l, 0>, <+l, +l, 0>, <-l, +l, 0>, <+l, +l, 0>, tt), R texture {tx_vermelho}} sphere{ arcobezier(0, 1, <+l, +l, 0>, <+l, +l, 0>, <-l, +l, 0>, <-l, +l, 0>, tt), R texture {tx_laranja}} sphere{ arcobezier(0, 1, <-l, +l, 0>, <+l, +l, 0>, <-l, +l, 0>, <-l, -l, 0>, tt), R texture {tx_verde}} */ #declare tt = tt + (1 / N); #end } #end #macro no1(R, N) #declare tamanho = 10; #declare l = tamanho / 2; union{ #declare tt = 0; #while (tt < 1) sphere{ arcobezier(0, 1, <2, -6, -5>, <-10, 30, 0>, <30, -10, 0>, <-6, 2, 5>, tt), R texture {tx_azul} } sphere{ arcobezier(0, 1, <2, -6, -5>, <10, -30, 0>, <-30, 10, 0>, <-6, 2, 5>, tt), R texture {tx_verde} } /* sphere{ arcobezier(0, 1, <-6, 2, 5>, <-10, 30, 0>, <30, -10, 0>, <2, -6, -5>, tt), R texture {tx_verde} } */ /* sphere{ interpolalin(0, <2, -6, 0>, 1, <-10, 30, 0>, tt), R texture {tx_verde} } sphere{ interpolalin(0, <-10, 30, 0>, 1, <30, -10, 0>, tt), R texture {tx_vermelho}} sphere{ interpolalin(0, <30, -10, 0>, 1, <-6, 2, 0>, tt), R texture {tx_laranja}} */ /* sphere{ arcobezier(0, 1, <+l, -l, 0>, <+l, +l, 0>, <-l, +l, 0>, <+l, +l, 0>, tt), R texture {tx_vermelho}} sphere{ arcobezier(0, 1, <+l, +l, 0>, <+l, +l, 0>, <-l, +l, 0>, <-l, +l, 0>, tt), R texture {tx_laranja}} sphere{ arcobezier(0, 1, <-l, +l, 0>, <+l, +l, 0>, <-l, +l, 0>, <-l, -l, 0>, tt), R texture {tx_verde}} */ #declare tt = tt + (1 / N); #end } #end // Aqui está a cena, finalmente: /* #include "eixos.inc" */ union { /* eixos(5) */ /* object{ circulo(1, 1000) texture{ tx_azul } } */ /* object{ quadrado(1, 1000) }//texture{ tx_azul } } */ /* object{ quadrado_esquisito(1, 1000) texture{ tx_azul } } */ object{ curvaloca(1, clock*1000) texture{ tx_azul } } //sphere { <1*clock, 1*clock, 1*clock>, 1*clock texture { tx_azul } } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 40.0; #declare dir_camera = < 10.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)