// CORES E TEXTURAS #include "eixos.inc" 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 < 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 } #declare roleta = seed(1); #declare chao = box{ <0,0,-2>, <+40,+40,-3> texture{tx_xadrez}} #declare cilindro_base = cylinder{ < 0.00, -1.00, 3.00>, < 0.00, +1.00, 3.00>, 0.75 texture{ tx_fosca } } #declare cone_asa_direita = cone{ <0.75, 0.00, 3.00>, 0.4, <2, 0.00, 3.00>, 0 texture{ tx_fosca } } #declare cone_asa_esquerda = cone{ <-0.75, 0.00, 3.00>, 0.4, <-2.00, 0.00, 3.00>, 0 texture{ tx_fosca } } #declare furo_cilindro = cylinder{ < 0.00, -2.00, 3.00>, < 0.00, +2.00, 3.00>, 0.5 texture{ tx_fosca } } #declare cilindro_tronco = cylinder{ < 0.00, 0.00, -2.00>, < 0.00, 0.00, 2.00>, 1 texture{ tx_fosca } } #declare esfera_tronco = sphere{ <0, 0, 3>, 1 texture{ tx_fosca } } #declare esfera_folha = sphere{ <0, 0, 3>, 2 texture{ tx_xadrez } } #macro galho () union{ difference{ object {cilindro_base} object {furo_cilindro} } object {cone_asa_direita translate < 0,-0.5,0 >} object {cone_asa_direita translate < 0,0.5,0 >} object {cone_asa_esquerda translate < 0,-0.5,0 >} object {cone_asa_esquerda translate < 0,0.5,0 >} } #end #macro esfera_galhos() union{ object{esfera_tronco translate<0, 0, 0>} object{galho() translate<0,+3.5,-0.25> rotate<30,0,0>} object{galho() translate<0,-3.5,-0.25> rotate<330,0,0>} } #end #macro tronco_arvore() union{ object {cilindro_tronco translate<0, 0, 0>} object {esfera_tronco translate<0,0,-6>} } #end #macro arvore (P, A, K, size_scale) #if (rand(roleta) < 0.8) union{ union{ object{tronco_arvore()} object{esfera_galhos()} } #if (K != 0) object{arvore(, A, K-1, size_scale/1.25) translate scale} object{arvore(, A, K-1, size_scale/1.25) translate scale} #else object{esfera_folha translate} #end } #else object{esfera_folha translate} #end #end #macro plantacao (N,A,K) union{ #local ii = 0; #while(ii < N) #local Xarvore = 40 * rand(roleta); #local Yarvore = 40 * rand(roleta); object{arvore(, A, K, 1)} #local ii = ii + 1; #end } #end object{ chao } object {plantacao(5, 20, 5)} #include "camlight.inc" #declare centro_cena = < 20.00, 20.00, 1.00 >; #declare raio_cena = 30.0; #declare dir_camera = <5, 4, 4 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)