// Joao Amancio Junior  RA007877   MP004 - Computacao Grafica
// 30/06/2001 - 14:00 hs

#include "colors.inc"
#include "metals.inc"
#include "golds.inc"
#include "stones1.inc"
#include "textures.inc"
background{ color rgb < 1.0, 1.0, 1.0 > }
  camera {
      location < 5, 15, 15 >  //visao geral
//    location < 0,  0, 45> //de cima
//      location < 0,  0, 0> //de frente
//    location < 20,  0, 0> //lado direito
    right < 0.40, 0.00, 0.00>
    up    < 0.00, 0.00, 0.30>
    sky   < 0.00, 0.00, 1.00>
    look_at <0,0,1>
  }
  light_source { < 10, 10, 10> color White }

#declare cor_ouro = <1,0.8,0.5>
#declare ouro = 
   texture {
      finish { ambient 0.05 diffuse 0.05 reflection cor_ouro  specular 0.20
               roughness 0.05 }
      pigment { rgb cor_ouro } }

#declare cor_cristal = <0,0,1>
#declare cristal = 
   texture {
      finish { ambient 0.1 diffuse 0.1 reflection 0.25  specular 1
               roughness 0.001 }
      pigment { color cor_cristal filter 1 } }
          
  

#declare eixoX = 
  cylinder {
    < -10, 0, 0 >, 
    < 10, 0, 0 >,
    0.01
     pigment { Green } 
  }

#declare eixoY = 
  cylinder {
    < 0,-10, 0 >,
    < 0, 10, 0 >,
    0.01
    pigment { Blue }
  }

#declare eixoZ = 
  cylinder {
    < 0, 0, -10 >,
    < 0, 0, 10 >,
    0.01
    pigment { Red}
  }

#declare piso =
        box {
              < -5.00, -5.00, -1.00 >,
              <  5.00,  5.00,  0.00 >
        texture { ouro }
        }

//plane{y, -10 pigment{checker color White color Blue}}
//plane{x, -10 pigment{checker color White color Green}}
plane{z, -10 pigment{checker color White color Red}}

//plane{y, -10 pigment{Blue}}
//plane{x, -10 pigment{Green}}
//plane{z, -10 pigment{Red}}

#declare ouro = T06

// object {piso}

//    eixoX
//    eixoY
//    eixoZ



#declare bezier_A =
  bicubic_patch { type 1 flatness 0.0100 u_steps 5 v_steps 5,
    
    <   0, -1.5,  0.9>,
    < 0.4, -1.5,  0.6>,
    < 0.7, -1.5,  0.3>,
    < 0.9, -1.5,  0.0>,
    
    < 0.0,  0.3,  1.2>,
    < 1.3,  0.3,  1.0>,
    < 1.3,  0.3,  0.5>,
    < 1.2,  0.3,  0.0>,

    <   0,  2.0,  0.6>,
    < 0.2,  2.0,  0.4>,
    < 0.4,  2.0,  0.2>,
    < 0.6,  2.0,  0.0>,

    <   0,  3.0,    0>,
    < 0.0,  3.0,  0.0>,
    < 0.0,  3.0,  0.0>,
    < 0.0,  3.0,  0.0>
   texture {cristal}    }
 
#declare bezier_B =
  bicubic_patch { type 1 flatness 0.0100 u_steps 5 v_steps 5,
    <   0, -1.5,  0.9>,
    < 0.4, -1.5,  0.6>,
    < 0.7, -1.5,  0.3>,
    < 0.9, -1.5,  0.0>,
    
    < 0.0, -2.0,  0.7>,
    < 0.3, -2.0,  0.5>,
    < 0.5, -2.0,  0.3>,
    < 0.7, -2.0,  0.0>,

    < 0.0, -2.5,  0.5>,
    < 0.3, -2.5,  0.4>,
    < 0.4, -2.5,  0.3>,
    < 0.5, -2.5,  0.0>,

    < 0.0, -3.0,  0.0>,
    < 0.0, -3.0,  0.0>,
    < 0.0, -3.0,  0.0>,
    < 0.0, -3.0,  0.0>
    texture {cristal} }
  
#declare bezier_C =
  bicubic_patch { type 1 flatness 0.0100 u_steps 3 v_steps 3,
    < 0.0, -1.5,  0.85>,
    < 0.1, -1.7,  1.3>,
    < 0.1, -2.0,  1.7>,
    < 0.1, -2.2,  1.9>,
    
    < 0.1, -2.0,  0.55>,
    < 0.1, -2.3,  1.1>,
    < 0.1, -2.5,  1.5>,
    < 0.1, -2.8,  2.1>,

    < 0.1, -2.5,  0.3>,
    < 0.1, -2.8,  0.8>,
    < 0.1, -3.0,  1.3>,
    < 0.1, -3.0,  1.55>,

    < 0.1, -3.0,  0.0>,
    < 0.1, -3.2,  0.5>,
    < 0.1, -3.3,  1.1>,
    < 0.1, -3.25,  1.4>
    texture { ouro } }



#declare bezier_Af =
  bicubic_patch { type 1 flatness 0.0100 u_steps 5 v_steps 5,
    
    <   0, -1.5,  -0.9>,
    < 0.4, -1.5,  -0.6>,
    < 0.7, -1.5,  -0.3>,
    < 0.9, -1.5,  -0.0>,
    
    < 0.0,  0.3,  -1.2>,
    < 1.3,  0.3,  -1.0>,
    < 1.3,  0.3,  -0.5>,
    < 1.2,  0.3,  -0.0>,

    <   0,  2.0,  -0.6>,
    < 0.2,  2.0,  -0.4>,
    < 0.4,  2.0,  -0.2>,
    < 0.6,  2.0,  -0.0>,

    <   0,  3.0,    0>,
    < 0.0,  3.0,  0.0>,
    < 0.0,  3.0,  0.0>,
    < 0.0,  3.0,  0.0>
    texture {cristal}    }

#declare bezier_Bf =
  bicubic_patch { type 1 flatness 0.0100 u_steps 5 v_steps 5,
    <   0, -1.5,  -0.9>,
    < 0.4, -1.5,  -0.6>,
    < 0.7, -1.5,  -0.3>,
    < 0.9, -1.5,  0.0>,
    
    < 0.0, -2.0,  -0.7>,
    < 0.3, -2.0,  -0.5>,
    < 0.5, -2.0,  -0.3>,
    < 0.7, -2.0,  0.0>,

    < 0.0, -2.5,  -0.5>,
    < 0.3, -2.5,  -0.4>,
    < 0.4, -2.5,  -0.3>,
    < 0.5, -2.5,  0.0>,

    < 0.0, -3.0,  0.0>,
    < 0.0, -3.0,  0.0>,
    < 0.0, -3.0,  0.0>,
    < 0.0, -3.0,  0.0>
    texture { cristal } }
  




union {
  object {bezier_A}
  object {bezier_B}
  object {bezier_C}
  object {bezier_A scale <-1,1,1>}
  object {bezier_B scale <-1,1,1>}
  object {bezier_C scale <-1,1,1>}

  object {bezier_Af}
  object {bezier_Bf}
}