// Last edited on 2003-10-15 00:12:23 by stolfi

#include "colors.inc"
#include "textures.inc"
#include "golds.inc"
#include "skies.inc" 

#declare ctr = <0, 0.5, 0>;      // Centro da cena
#declare camdir = <5, 2, -13>; // Direção da câmera
camera {
    location ctr + 0.7*camdir
    right -0.60*x 
    up    0.80*y
    sky   y
    look_at ctr
} 

plane { y, -5  //this is the grout
   pigment { checker color Black, color White scale 3 }
   finish { ambient .4 diffuse .6 }
}

light_source{ <10, 30, -100> color rgb 1.2*White }
light_source{ <30, 20, -10> color rgb 0.6*White }
sky_sphere { S_Cloud5 }

#declare bumbum =
 union{
    
    sphere { <0, 0, 0>, 0.5

      pigment { color rgb < 0.3, 0.7, 1.0 > }

      translate -0.25*x

    }

    
    sphere { <0, 0, 0>, 0.5

      pigment { color rgb < 0.3, 0.7, 1.0 > }

      translate 0.25*x

    }

  }
  
 #declare saia =
 difference {
 intersection {
   cone {
     <0,0.5,0>,
     0.7,
     <0,-0.4,0>,
     1.2
     pigment { Yellow }
   }
   cone {
     <0,0.5,0>,
     0.65,
     <0,-0.4,0>,
     1.15
     pigment { Yellow }
   }
   }
  }
  
  
#declare tronco =
 cone {
   <0,0.5,0>,
   0.15,
   <0,2,0>,
   1
   pigment { color rgb < 0.3, 0.7, 1.0 >}
   scale <1.1,1,0.5>

 }
 
#declare pescoco =
 cylinder {
   <0,2,0>,   
   <0,2.5,0>,
   0.20
   pigment { color rgb < 0.3, 0.7, 1.0 >}

 }
 
#declare cranio =
sphere{
    <0,3.6,0>,
    1
    pigment { color rgb < 0.3, 0.7, 1.0 >}
    scale<0.4,0.8,0.4>
    //rotate 10


}
#declare cucuruto =
difference {
 sphere{
    <0,3.5,0>,
    1.2
    pigment { Yellow}
    scale<0.4,0.8,0.4>
    //rotate 10    
}
box {
  <-2,0.5,-2>,
  <8,3.2,+5>
}

}
#declare fios =
difference {
  difference {
  	cone {
	   <0,2.2,0>,
	   1,
	   <0,3.7,0>,
	   0.2
	   pigment {Yellow}
	}
	cone {
	   <0,2.2,0>,
	   0.9,
	   <0,3.7,0>,
	   0.1
	   pigment {Yellow}
	}
	}
   box {
	<3,0.5,-2>,
       <-3,5,0>
  }

}

#declare coxaDir =
cylinder {
   <0.3,-0.5,0>,   
   <1.1,-1.6,0>,
   0.18
   pigment { color rgb < 0.3, 0.7, 1.0 >}
}
#declare batataDir =
cylinder {
   <1.2,-1.70,0>,
   <0.3,-3.0,0>   
   0.16
   pigment { color rgb < 0.3, 0.7, 1.0 >}
}
#declare peDir =
sphere {
   <0.35,-3.0,0>,
   0.3
   pigment { White}
   scale<0.7,1,1.2>
}
#declare joelhoDir =
sphere {
   <1.2,-1.65,0>,
   0.2
   pigment { color rgb < 0.3, 0.7, 1.0 >}
}
#declare coxaEsq =
cylinder {
   <-0.3,-0.5,0>,   
   <-1,-1.6,0>,
   0.18
   pigment { color rgb < 0.3, 0.7, 1.0 >}
}
#declare batataEsq =
cylinder {
   <-1,-1.70,0>,
   <-0.3,-3.0,0>   
   0.16
   pigment { color rgb < 0.3, 0.7, 1.0 >}
}
#declare peEsq =
sphere {
   <-0.25,-3.0,0>,
   0.3
   pigment { White}
   scale<0.7,1,1.2>
}
#declare joelhoEsq =
sphere {
   <-1.,-1.65,0>,
   0.2
   pigment { color rgb < 0.3, 0.7, 1.0 >}
}

#declare bracoDir =
cylinder {
   <1.7,3.3,0>,   
   <0.5,4,0>,
   0.14
   pigment { color rgb < 0.3, 0.7, 1.0 >}
}
#declare bracoEsq =
cylinder {
   <-1.7,3.3,0>,   
   <-0.5,4,0>,
   0.14
   pigment { color rgb < 0.3, 0.7, 1.0 >}
}
#declare anteBracoDir =
cylinder {
   <1.7,3.2,0>,
   <1,2,0>,      
   0.14
   pigment { color rgb < 0.3, 0.7, 1.0 >}
}
#declare anteBracoEsq =
cylinder {
   <-1.7,3.2,0>,
   <-1,2,0>,      
   0.14
   pigment { color rgb < 0.3, 0.7, 1.0 >}
}
#declare cotoveloDir =
sphere {
   <1.7,3.3,0>,
    0.2
    pigment { color rgb < 0.3, 0.7, 1.0 >}    

}
#declare cotoveloEsq =
sphere {
   <-1.7,3.3,0>,
    0.2
    pigment { color rgb < 0.3, 0.7, 1.0 >}    

}
#declare maoDir =
sphere {
   <0.3,4,0>,
    0.2
    pigment { White}    
    scale<1.1,1,1>   
 }
#declare maoEsq =
sphere {
   <-0.3,4,0>,
    0.2
    pigment { White}    
    scale<1.1,1,1>   
 }
#declare bracoDireito =
union {
   object{bracoDir}
   object{anteBracoDir}
   object{cotoveloDir}   
   object{maoDir}
}
#declare bracoEsq =
union {
   object{bracoEsq}
   object{anteBracoEsq}
   object{cotoveloEsq}   
   object{maoEsq}
   
}
#declare pernaDir =
union {
   object{coxaDir}
   object{joelhoDir}
   object{batataDir}   
   object{peDir}
}
#declare pernaEsq =
union {
   object{coxaEsq}
   object{joelhoEsq}
   object{batataEsq}   
   object{peEsq}
}
union {}
#declare cabelo =
union {
  object {cucuruto}
  object {fios}
} 
#declare olhos=
sphere {
    <0.17,2.9,-0.3>,
    0.1
    pigment { White}
}
sphere {
    <-0.17,2.9,-0.3>,
    0.1
    pigment { White}
}
#declare boca=
union{
    
    sphere { <0, 2.5, -0.3>,
    	      0.1
	      pigment { Red}
	      translate -0.05*y
	      scale<1.7,1,1>

    }

    
    
    sphere { <0, 2.5, -0.3>,
    	      0.1
	      pigment { Red}
	      translate 0.05*y
	      scale<1.7,1,1>

    }
}
#declare rosto=
 union{
     object{olhos}
     object{boca}
 
 }


// Aqui está a cena, finalmente:  

union {
   object {bumbum}
   object {saia}
   object {tronco}
   object {pescoco}
   object {cranio}
   object {cabelo}
   object {bracoDireito}
   object {bracoEsq}
   object {rosto}
   object {pernaDir}
   object {pernaEsq}
}