// Exemplo de arquivo de descricao de cena para POV-ray
// Last edited on 2020-09-30 19:57:13 by jstolfi

// ======================================================================
// CORES E TEXTURAS

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 < 0.50, 0.80, 0.90 > }
    finish{ diffuse 0.9 ambient 0.1 }
  }

#declare tx_espelho = 
  texture{
    pigment{ color rgb < 0.00, 0.85, 0.60 > }
    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.05, 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.90, 0.32, 0.90 >, color rgb < 1.00, 0.97, 0.50 > }
    finish{ diffuse 0.9 ambient 0.1 }
    scale 2.0
  }

  #declare tx_apoio = 
  texture{
    pigment{ color rgb < 0.10, 0.80, 0.00 > }
    finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 }
  }

// ======================================================================
// DESCRI��O DA CENA 

#declare chao = //plano
  box{ <-20,-20,-1>, <+20,+20,0> }

#declare raio = 2.000;

// Partes da cena:

#declare torre_de_suporte1 = box {
    <0, 0, 0>, <0.5, 0.5, 3> // <x, y, z> near lower left corner, <x, y, z> far upper right corner
    
}

#declare cylinder_role = cylinder {
    <0.3, -0.5, 1.5>, <0.2, 1, 1.5>, 0.2 // center of one end, center of other end, radius
    open // remove end caps
    
}

#declare cone_base_floor = cone {
    <0.25, 1.25, 0>, 0.75 // <x, y, z>, center & radius of one end
    <0.25, 1.25, 1.5>, 0.05 // <x, y, z>, center & radius of the other end
    
}


#declare cone_seat = cone {
    <0.25, 1.25, 1.5>, 0.05 // <x, y, z>, center & radius of one end
    <0.25, 1.25, 3>, 0.75 // <x, y, z>, center & radius of the other end
    
}

#declare MySphere = sphere {
    <0.2, 0.2, 3.0>, 0.2 // <x, y, z>, radius
    
}

#declare sphere_cut = box {
    <0, 0, 3>, <0.5, 0.5, 3.50> // <x, y, z> near lower left corner, <x, y, z> far upper right corner
    
}




#include "eixos.inc"

// Aqui est� a cena, finalmente:

union{
  object{ eixos(3.00)}
  object{ chao  translate < 0,0,-5 > texture{ tx_xadrez } }
  //object {base_cone_floor}
  difference {
    object{torre_de_suporte1 texture{tx_plastico}}
    object{cylinder_role}
  }
  intersection {
    object {
    MySphere texture {tx_apoio}
}
    object {
    sphere_cut
}
  }
  

  difference {
    object{torre_de_suporte1 texture{tx_plastico}}
    object{cylinder_role texture {tx_fosca}}
    translate <0, 2, 0>
  }
}

intersection {
    object {
    MySphere texture {tx_apoio}
}
    object {
    sphere_cut
}
translate <0, 2, 0> // <x, y, z>
  }


union{
    object {
    cone_seat texture {tx_fosca}
}
    object {
    cone_base_floor texture {tx_fosca}
}
}

#include "camlight.inc"
#declare centro_cena = < 0.00, 0.00, 1.00 >;
#declare raio_cena = 6.0;
#declare dir_camera = < 5.00, 3.00, 3.00 >;
#declare dist_camera = 5*raio_cena;
#declare intens_luz = 1.20;
camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)