// Exemplo de arquivo de descricao de cena para POV-ray
// Last edited on 2003-10-14 21:43:44 by stolfi

// Cores
#include "colors.inc"
// various (mostly layered) wood textures
// T_Wood1 - T_Wood35
#include "woods.inc"

// several different gold colors, finishes and textures
#include "golds.inc"

// various metal colors, finishes and textures
// brass, copper, chrome, silver
#include "metals.inc"

// various glass finishes, colors and interiors
//
#include "glass.inc"

 

// ======================================================================
// CÂMERA padrão

#declare ctr = < 0.00, 25.00, 0.00 >;
#declare camdir = < 20, 30.0, -76.0 >;

camera {
  location ctr + 0.95*camdir    // Posição do observador.
  right -0.60*x                         // Largura relativa da imagem
  up    0.80*y                          // Altura relativa da imagem
  sky   y                               // Eixo vertical da cena
  look_at   ctr      // Para onde a câmera está apontando.
} 

// ======================================================================
// FONTES DE LUZ

// An area light (creates soft shadows)
// WARNING: This special light can significantly slow down rendering times!
light_source {
  0*x                 // light's position (translated below)
  color rgb 2.0       // light's color
  area_light
  <2, 0, 2> <-2, 0, -2> // lights spread out across this distance (x * z)
  4, 4                // total number of lights in grid (4x*4z = 16 lights)
  adaptive 0          // 0,1,2,3...
  jitter              // adds random softening of light
  scale 7000
  translate 1000*<5, 80, -60>   // <x y z> position of light  
}

light_source {
  0*x                 // light's position (translated below)
  color rgb 0.8       // light's color
  translate 1000*<-25, 20, -60>   // <x y z> position of light  
}

// ======================================================================
// DESCRIÇÃO DA CENA 

#declare perna = 
	union {
		object {	//peh
			difference {
				union { 
					sphere {
						<0, 0, 0>, 1.5
						translate <-3.5, 0.0, 0>
					}
					sphere {
						<0, 0, 0>, 1.5
						translate <3.5, 0.0, 0>
					}
					cylinder {
						<-3.5, 0.0, 0>, <3.5, 0.0, 0>, 1.5
					}
				}
				plane { 
					y, 0
				}
			}
			pigment {
				color Black
			}
			scale <1, 1, 4>
			translate <0, 0, -2>
		}
		object { 	//canela
			cylinder {
				<0, -0.5, 0>, <0, 4.5, 0>, 2 //.5 para 'entrar' e evitar superficies conflitantes
			}
			pigment {
				color Gray
			}
			translate <0, 1.5, 0>
		}
		object {	//joelho
			union { 
				sphere {
					<0, 0, 0>, 1.5
					translate <-1, 0.0, 0>
				}
				sphere {
					<0, 0, 0>, 1.5
					translate <1, 0.0, 0>
				}
				cylinder {
					<-1, 0.0, 0>, <1, 0.0, 0>, 1.5
				}
			}
			pigment {
				color Red
			}
			scale <1, 1, 2>
			translate <0, 6.5, 0>
		}
		object {	//coxa
			cylinder {
				<0, -0.5, 0>, <0, 7.5, 0>, 2 //.5 para 'entrar' e evitar superficies conflitantes
			}
			pigment {
				color Gray
			}
			translate <0, 8.5, 0>
		}
		object {	// ligacao coxa/tronco
			union { 
				sphere {
					<0, 0, 0>, 1
					translate <-1, 0.0, 0>
				}
				sphere {
					<0, 0, 0>, 1
					translate <1, 0.0, 0>
				}
				cylinder {
					<-1, 0.0, 0>, <1, 0.0, 0>, 1
				}
			}
			pigment {
				color Red
			}
			scale <1, 1, 2>
			translate <0, 15.5, 0>
		}
	}

#declare tronco =
	object {
	union {
		object {	//ventre
			box {
				<-5.5, -2, -4>, <5.5, 2, 4>
			}
			pigment {
				color DarkBrown
			}
		}
		object {	//torax
			intersection {
				box {
					<-5.5, -8, -4>, <5.5, 8, 4>
				}
				cone {
					<0, -8, 0>,  5.5
					<0, 8, 0>, 3
				}
			}
			pigment {
				color Brown
			}
			translate <0, 10, 0>
		}
	}
	scale <1.5, 1, 1>
}

#declare cabeca = union {
	object {	//pescoco
		cone {
			<0, -0.6, 0>, 3.1
			<0, 0.6, 0>, 2.1
		}
		pigment {
			color Red
		}
	}
	box {	//cabeca
		<-4, -4, -4>, <4, 4, 4> 
		pigment {
			color Gray
		}
		translate <0, 4.8, 0>
	}
	box {	//olho
		<-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>
		pigment { color White }
		translate <-2, 6, -3.8>
	}
	box {	//olho
		<-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>
		pigment { color White }
		translate <2, 6, -3.8>
	}
	box {	//boca
		<-2.5, -0.5, -0.5>, <2.5, 0.5, 0.5>
		pigment { color Red }
		translate <0, 2, -3.7>
	}
}

#declare braco = union {
	sphere {
		<0, 0, 0>, 3
		scale <0.6, 0.6, 0.5>
		pigment { color Red }
	}
	cylinder {
		<0, 0, 0>, <7, 0, 0>, 1
		pigment { color Gray }
		translate <0.8, 0, 0>
	}
	sphere {
		<0, 0, 0>, 3
		scale <0.6, 0.6, 0.5>
		pigment { color Red }
		translate <7.8, 0, 0>
	}
	cylinder {
		<0, 0, 0>, <5, 5, 0>, 1
		pigment { color Gray }
		translate <8.3, 0, 0>
	}
	sphere {
		<0, 0, 0>, 2
		pigment { color Yellow }
		translate <13.3, 5, 0>
	}
}

#declare chapeu = union {
	object {	//topo
		difference {
			sphere {
				<0, 0, 0>, 4
			}
			plane { 
				y, 0
			}
		}
	}
	cone {	//aba
		<0, -0.1, 0>, 7
		<0, 0.1, 0>, 4
	}	
	pigment {
		color DarkSlateBlue
	}
}

#declare robo = union {
object {
	perna
	translate <-5.5, 0, 0>
}
object {
	perna
	translate <5.5, 0, 0>
}
object {
	tronco
	translate <0, 18, 0>
}
object {
	cabeca
	translate <0, 36.5, 0>
}
object {
	braco
	translate <6, 31, 0>
}	
object {
	braco
	rotate <180, 180, 0>
	translate <-6, 31, 0>
}
object {
	chapeu
	translate <0, 46, 0>
}
}

//Cena
background{ color Gray }

sky_sphere { //céu
  pigment {
    gradient y
    color_map { [0.0 color rgb <0.7,0.7,1.0>] [1.0 color blue 0.5] }
  }
}

plane { //chão
  -y, 0
  texture
  {
    T_Wood1
  }
}

robo