// Last edited on 2003-12-14 22:47:54 by stolfi

#include "colors.inc"
#include "metals.inc"
#include "golds.inc"
#include "stones1.inc"
#include "textures.inc"

background{ color rgb <1,1,1> }

//definicao da camera
#declare ctr = < 0.00, 1.00, 0.00 >;
#declare camDir = < 1, 2, 14 >;

camera {
  location   ctr + 1.00*camDir
  right      -0.45*x
  up         0.45*z
  sky        y
  look_at    ctr
}

light_source {
  20*< 0.0, 50.0, 2.0 >              // Posição da lâmpada.
  color rgb 1.0 * < 1.00, 1.00, 1.00 >      // Intensidade e corda luz.
} 

light_source {
  20*< -10.0, 2.0, 50.0 >              // Posição da lâmpada.
  color rgb 0.7 * < 1.00, 1.00, 1.00 >      // Intensidade e corda luz.
} 

light_source {
  20*< 10.0, 2.0, 50.0 >              // Posição da lâmpada.
  color rgb 0.6 * < 1.00, 1.00, 1.00 >      // Intensidade e corda luz.
} 

#declare cor_cristal = < 0.8,0.9,1.5>;   
#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 cor_cristal2 = < 1,1,0>;   
#declare cristal2 = 
  texture {
         finish {
          ambient 0.1 
    diffuse 0.1
          reflection 0.25
          specular 1 
    roughness 0.001
                }
      pigment { color cor_cristal2 filter 1}
    }

#declare prata = 
material {
    texture { 
    pigment { Silver } 
    finish {
      ambient 0.05 diffuse 0.05
      reflection Silver metallic
      specular 0.2 roughness 0.001
    }
  }
}

#declare prata_escura = 
material {
    texture { 
    pigment { rgb 0.1 } 
    finish {
      ambient 0.05 diffuse 0.05
      reflection rgb 0.1 metallic
      specular 0.2 roughness 0.001
    }
  }
}

#declare ouro = 
material {
    texture { 
    pigment { BrightGold } 
    finish {
      ambient 0.05 diffuse 0.05
      reflection BrightGold metallic
      specular 0.2 roughness 0.001
    }
  }
}

#declare cristal_vermelho =
material {
  texture {
    pigment { rgbf <0.65, 0.1, 0.1, 0.80>  }
    finish {
      ambient 0.1 diffuse 0.1
      reflection 0.25
      specular 1 roughness 0.001
    }
  }
  interior {ior 1.1}
}

// OBJETOS ///

#declare fundo =
    box{
  <-2,0,0.8>,
  <2,2,1.5>
  material {cristal_vermelho}
}

#declare rolo_esq =
   cylinder {
  <-2.2, 0, 1.15>,
  <-2.2, 2, 1.15>,
  0.3
  material {prata}
}

#declare rolo_dir =
   cylinder {
  <2.2, 0, 1.15>,
  <2.2, 2, 1.15>,
  0.3
  material {prata}
}


#declare letraL_1 =
 lathe {
    linear_spline
    7,
    <0, 1.5>, <0.2, 1.5-1/6>, <0, 1.5-2/6>, <0.2, 1.5-3/6>, <0,1.5-4/6>, <0.2,1.5-5/6>, <0,0.5>
    material {ouro}
    finish {
      ambient 0.05
      phong 0.2
    }
  translate 1.55*z
  translate -1*x
  }

#declare letraL_2 =
 lathe {
    linear_spline
    5,
    <0, 1.5-2/6>, <0.2, 1.5-3/6>, <0,1.5-4/6>, <0.2,1.5-5/6>, <0,0.5>
    material {ouro}
    finish {
      ambient 0.05
      phong 0.2
    }
  rotate -90*z
  translate 1.55*z
  translate 0.5*y
  translate -1.5*x
  }

#declare letraI_1 =
    cone {
  <-0.1, 0.3, 1.55>, 0.15
  <-0.1, 1.3, 1.55>, 0
  material {prata}
}


#declare letraV =
prism {

    linear_sweep

    cubic_spline

    0,  // sweep the following shape from here ...

    1,  // ... up through here

    18, // the number of points making up the shape ...

    <3,-5>, <3,5>, <-5,0>, <3, -5>, <3,5>, <-5,0>, // sub-shape #1

    <2,-4>, <2,4>, <-4,0>, <2,-4>, <2,4>, <-4,0>,  // sub-shape #2

    <1,-3>, <1,3>, <-3,0>, <1, -3>, <1,3>, <-3,0>  // sub-shape #3
   
   material {ouro}
   rotate 90*x
   rotate 90*z  

   scale <0.09,0.15,0.25>

   translate 0.5*x
   translate 0.9*y
  }
 
#declare parte1 =
  torus {
    0.2, 0.05
    material {ouro}  
    rotate 90*x
}

#declare corte1=
  box {
  <-1,-1,-1>,
  <1,0,1>
  material {ouro}
}

#declare corte2=
  box {
  <1,1,1>,
  <-1,0,-1>
  material {ouro}
}
#declare cima =
   difference {
   object {parte1 scale 1.7*x}
   object {corte1}
}
#declare baixo =
  difference {
   object {parte1 scale 1.7*x}
   object {corte2}
}

#declare olho =
 union{
object {cima}
object {baixo}
}

// Aqui está a cena, finalmente:

union {
  object {fundo}
  object {rolo_esq}
  object {rolo_dir}
}

union {
  object {letraL_1}
  object {letraL_2}
}

object {letraI_1}

object {letraV translate 1.45*z translate 0.3*x}

object {olho translate 1.5*z translate 1.6*y }//translate -0.3*x }

plane{
  y, 0
  texture{ 
    pigment{ checker color rgb <0.4,0.5,0.6>, color rgb <0.7,0.75,0.8> }
    finish{ ambient 0.3 diffuse 0.7 } 
  }
}