// Last edited on 2017-05-07 20:06:47 by stolfilocal // Processed by remove-cam-lights 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.90, 0.0 > } 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 } #macro no_rede ( p, tam ) union{ #if (tam < 0.2) #declare tam = tam + 0.2; #end sphere{ p, tam texture{ tx_plastico }} } #end #macro enlace_no (p, q, tp, rr) union { cylinder{ p, q, 0.2 texture{ tx_fosca } } #if (tp = 1) sphere{ ((1-rr) * p + (rr * q)), 0.8 texture{ tx_xadrez }} #end } #end #include "eixos.inc" #declare tamr = 40; #macro rede (hosts, enlace) #declare serie = seed(417); union { #declare nos = array[ hosts ]; #declare tamanho = array[ hosts ]; #declare i = 0; # while (i < hosts) #declare nos[i] = ; #declare tamanho[i] = 2 * rand(serie); object{ no_rede (nos[i], tamanho[i]) } #declare i = i + 1; #end #declare i = 0; # while (i < enlace) #declare indice = int ((hosts-2) * rand(serie)); #declare indice2 = int ((hosts-2) * rand(serie)); # if (indice = indice2) #declare indice2 = indice2 + 1; #end object{ enlace_no (nos[indice], nos[indice2], int (rand(serie)), rand(serie)) } #declare i = i + 1; #end } #end rede (100, 200) #include "camlight.inc" #declare centro_cena = 0.5*tamr * < 1, 1, 1 >; #declare raio_cena = 1.00*tamr; #declare dir_camera = < 10.00, 10.00, 10.00 >; #declare dist_camera = 8*raio_cena; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)