// Exemplo de arquivo de descricao de cena para POV-ray
// Last edited on 2023-09-13 16:34:36 by stolfilocal

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

//#include "textures.inc"

background{ color rgb < 0.05, 0.10, 0.50 > }

#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.5  ambient 0.02 specular 0.25 roughness 0.005 }
  }


#declare tx_xadrez =
  texture{
    pigment{ checker color rgb < 0.90, 0.0, 0.60 >, color rgb < 1.00, 0.97, 0.90 > }
    finish{ diffuse 0.9 ambient 0.1 }
    scale 2.0
  }

#declare tx_xadrez3 =
  texture{
    pigment{ checker color rgb < 0.00, 0.90, 0.60 >, color rgb < 1.00, 0.97, 0.90 > }
    finish{ diffuse 0.9 ambient 0.1 }
    scale 2.0
  }


#declare tx_xadrez2 =
  texture{
    pigment{ checker color rgb < 0.00, 0.0, 0.60 >, color rgb < 1.00, 0.97, 0.90 > }
    finish{ diffuse 0.9 ambient 0.1 phong 1 }
    scale 2.0
  }

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

#declare raio = 2.000;

// Partes da cena:
  
#declare bolinha = 
  sphere{ < 0,0,0 >, 0.60 }
 
#declare bolota = 
  sphere{ < 0,0,0 >, 1.50 }
 
#declare bola =
  sphere{
    < 0.00, 0.00, 0.00 >, raio 
    texture{ tx_plastico }
  }
  
#declare pino = 
  cylinder{
    < -2.00, +2.00, -1.00 >,
    < +2.00, -2.00, +1.00 >,
    0.25
    texture{ tx_fosca }
  }
  
#declare furo = 
  cylinder{
    < -1.00, -2.00, -2.00 >,
    < +1.00, +2.00, +2.00 >,
    0.2*raio
    texture{ tx_fosca }
  }

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


#declare caixa = 
  box{ <-8,-5,-1>, <+8,+5,0> }


#declare rosca = 
  torus {
    4, 1              // major and minor radius
    rotate -180*x      // so we can see it from the top
  }


#include "eixos.inc"

// Aqui est� a cena, finalmente:

union{
  // object{ eixos(3.00) }
  // object{ chao  translate < 0,0,-5 > texture{ tx_xadrez } }

  union{
    object{ bolota  translate < 1,-3,0 > texture{ tx_xadrez } }
    object{ bolota  translate < 1,3,0 > texture{ tx_xadrez } }
    object{ box{ <-8,-3,1>, <+2,+3,2> } texture{ tx_xadrez2} }
    object{   cylinder{
    < -8, -5.00, 0 >,
    < -8, +5.00, 0 >,
    1*1.50} texture{tx_xadrez}}
    
    union{
        object{   cylinder{
          < -10, 2.00, 5>,
          < 8, 2.00, 5 >,
          0.5*1.50} texture{tx_xadrez2}}
        
        object{   cylinder{
          < -10, -2.00, 5>,
          < 8, -2.00, 5>,
          0.5*1.50} texture{tx_xadrez2}}
        object{ box{ <-8,-4,8>, <+2,+4,3> } texture{ tx_xadrez3} }
    
      union{
        object{ cone{ <-3,0,15>, 0, <-3,0,8>, 2 } texture{ tx_xadrez} }
        object{ cone{ <-3,4,6>, 2, <-3,8,6>, 0} texture{ tx_xadrez} }
        object{ bolinha  translate < -3,0,15 > texture{ tx_xadrez } }
        
        union{
          object{ box{ <-2.4,-1.2,15>, <-4.2,1.2,16> } texture{ tx_xadrez3} }
        
          object{ bolinha  translate < -3,-1.2,15 > texture{ tx_xadrez } }
          object{ bolinha  translate < -3,1.2,15 > texture{ tx_xadrez } }
        }
      
        

        intersection {
          object{ box{ <-8,-4,8>, <+2,+4,3> } rotate -45*x texture{ tx_xadrez3} }
          object{ box{ <-8,-4,6>, <+2,+10,4> } texture{ tx_xadrez2} }
        }
      }
    }


    difference{
      object{ box{ <-8,-3,1>, <+2,+3,3> } texture{ tx_xadrez2} }
      object{   cylinder{
          < -10, 1.00, 2 >,
          < 8, 1.00, 2>,
          0.5*1.50} texture{tx_xadrez2}}
      
    }
    
    
    
  }


  light_source {
    <0, 10, -3>
    color rgb < 200/255, 42/255, 222/255 >
    spotlight
    radius 100
    falloff 30
    tightness 10
    point_at <0, 0, 1>
  }
}

#include "camlight.inc"
#declare centro_cena = < 0.00, 0.00, 7.50 >;
#declare raio_cena = 17.0;
#declare dir_camera = < 25.00, 20.00, 10.00 >;
#declare dist_camera = 1*raio_cena;
#declare intens_luz = 1.10;
camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)