#include "colors.inc"
#include "textures.inc"

#declare fixed_vertex = < 0.300721, -4.3117, +9.01769 >

// Camera position

#declare campos = < +440, -280, fixed_vertex.z >  // location
#declare camaim = fixed_vertex                    // aim point

#declare camlook = camaim

camera {
  location  campos
  direction < -2.00,  00.00, 00.00 >
  up        < 00.00,  00.00, -0.24 >
  right     < 00.00,  +0.18, 00.00 >
  sky       < 00.00,  00.00, -1.00 >
  look_at   camlook
}

// Lights

light_source { 1000*< +1, -2, -1 >  color rgb <0.5, 0.5, 0.5> }
light_source { 1000*< +1, -1, -4 >  color rgb <0.5, 0.5, 0.5> }
light_source { 1000*< -1, -2, -1 >  color rgb <0.5, 0.5, 0.5> }
light_source { 1000*< +1, +3, -1 >  color rgb <0.5, 0.5, 0.5> }

// Background

#declare hv = vnormalize( < -campos.y, campos.x, 000 > )
#declare gridsp = 17.5  // Grid spacing
#declare gridth = 0.17  // Grid line thickness

#declare cross_hairs = 
  merge {
    cylinder { -600 * hv, +600 * hv, gridth }
    // cylinder { -600 * hv, +600 * hv, gridth translate < 0, 0, +gridsp > }
    // cylinder { -600 * hv, +600 * hv, gridth translate < 0, 0, -gridsp > }
    cylinder { < 0, 0, -600 >, < 0, 0, +600>, gridth }
    // cylinder { < 0, 0, -600 >, < 0, 0, +600>, gridth translate +gridsp * hv }
    // cylinder { < 0, 0, -600 >, < 0, 0, +600>, gridth translate -gridsp * hv }
    texture { 
      // pigment { rgb < 1.00, 0.90, 0.50 > } 
      // pigment { MidnightBlue } 
      pigment { rgb < 0.000, 0.400, 0.671 > }  // Dark sky blue
      finish { ambient 0.2 diffuse 0.8 }
    }
    translate fixed_vertex
    translate -0.1 * ( campos - camaim )
  }
  
object { cross_hairs }

sky_sphere {
  pigment {
    // color rgb < 0.400, 0.671, 1.000 >  // Light sky blue
    color rgb < 0.192, 0.671, 1.000 >  // Medium sky blue
    // color rgb < 0.000, 0.400, 0.671 >  // Dark sky blue
//      gradient z
//      color_map {
//        [ 0.5  color SkyBlue ]
//        [ 1.0  color MidnightBlue ]
//      }
//      scale 2
//      translate -1*z
    }
}