// Last edited on 2005-01-06 00:19:40 by stolfi
// Processed by remove-cam-lights

#include "textures.inc"
#include "colors.inc"

background{ color rgb < 0.75, 0.80, 0.85 > }

#declare raio = 2.000;

#declare tinta1 =
  texture {
    pigment { color rgb < 0.10, 0.80, 1.00 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 }
  }

#declare tinta2 =
  texture {
    pigment { color rgb < 0.40, 0.10, 0.70 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 }
  }

#declare tinta3 =
  texture {
    pigment { color rgb < 0, 0, 0 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 }
  }

#declare tinta4 =
  texture {
    pigment { color rgb < 0.0, 0.0, 0.0 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 }
  }

#declare tinta5 =
  texture {
    pigment { color rgb < 1, 1, 1 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 }
  }

#declare tinta6 =
  texture {
    pigment { color rgb < 1, 1, 0 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 }
  }
#declare tinta7 =
  texture {
    pigment { color rgb < 1, 1, 1 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 }
  }

#declare eixoX =
  cylinder {<-300,0,0>,<300,0,0>,.1
            texture {tinta1}
           }

#declare eixoY =
  cylinder {<0,-300,0>,<0,300,0>,.1
            texture {tinta2}
           }

#declare eixoZ =
  cylinder {<0,0,-300>,<0,0,300>,.1
           texture {tinta3}
           }

#declare eixos=
  union{
   object{eixoX}
   object{eixoY}
   object{eixoZ}
  }

#declare fundo =
  plane {z,0
  texture{Jade}
  scale 0.5
}

#declare vertice =
  sphere{ <0,0,0>,.6 texture{tinta1}}

#declare aresta=
  cylinder{<0,0,0>,<5,0,0>,.1 texture{tinta2}}

#declare gerador = seed(10);

#macro GRAFO(x_pos, y_pos, z_pos, chance_de_parar)

    #declare a = rand(gerador)*3.5;

    #local xl = x_pos;
    #local yl = y_pos;
    #local zl = z_pos;
    #local cl = chance_de_parar;

    object{vertice translate <xl, yl, zl>}

    #if (cl < .5)
      #if (a > 3)

        object{aresta translate <xl, yl, zl>}
        GRAFO(xl+5, yl, zl, cl + .01)
        object{aresta rotate 90*z translate <xl, yl, zl>}
        GRAFO(xl, yl+5, zl, cl + .01)
        object{aresta rotate -90*y translate <xl, yl, zl>}
        GRAFO(xl, yl, zl+5, cl +.1)
      #else
        #if (a>2)
          object{aresta rotate 90*z translate <xl, yl, zl>}
          GRAFO(xl, yl+5, zl, cl +.1)
          object{aresta rotate -90*y translate <xl, yl, zl>}
          GRAFO(xl, yl, zl+5, cl +.1)

        #else
          object{aresta translate <xl, yl, zl>}
          GRAFO(xl+5, yl, zl, cl + .1)
          object{aresta rotate -90*y translate <xl, yl, zl>}
          GRAFO(xl, yl, zl+5, cl+.1)
        #end
      #end
     #end

  #end

union{
  GRAFO(0,0,-10,0)

 }

#include "camlight.inc"
camlight(<0,0,0>,<40,40,16>,1.00,z,1.0)