// Shows the path of the sun on the sky // Last edited on 2005-08-29 08:46:20 by stolfi #include "lights-detail.inc" background { color rgb < 0.800, 0.800, 0.800 > } global_settings { max_trace_level 10 } #include "astronomy.inc" #macro sun_texture(season) #local sun_hue = 0.800 + 0.200*sin(season*2*pi); texture { pigment { color rgb < 1.000, sun_hue, 0.500 > } finish { ambient 0.70 diffuse 0.30 } } #end #macro sun_in_place(latitude, season, hour, rad) #local sun_dir = compute_sun_direction(latitude, season, hour); sphere { sun_dir, rad sun_texture(season) no_shadow } #end #macro sun_orbit(latitude, season, rad) #local sun_dir = compute_sun_direction(000, season, 1200); torus { sun_dir.z, rad translate sun_dir.y*y rotate latitude*x sun_texture(season) no_shadow } #end #macro heavens() #local tx_sky = texture { pigment { color rgb < 0.500, 0.600, 1.000 > transmit 0.75 } finish { ambient 0.40 diffuse 0.60 } } intersection { sphere { <0,0,0>, 1 texture { tx_sky } } plane { -z,0 texture { tx_ground } } } #end #local tx_ground = texture { pigment { color rgb < 0.800, 0.700, 0.400 > } finish { ambient 0.20 diffuse 0.80 } } #local ground = plane { -z,0 translate -0.01*z texture { tx_ground } } #local latitude = -22; // Campinas, SP, Brazil intersection { union { #local hour = 0; #while (hour < 24) #local rad = 0.03; #if (mod(hour,6) = 0) #local rad = 0.05; #end sun_in_place(latitude, 0.00, hour, rad) sun_in_place(latitude, 0.25, hour, rad) sun_in_place(latitude, 0.75, hour, rad) #local hour = hour+1; #end sun_orbit(latitude, 0.00, 0.015) sun_orbit(latitude, 0.25, 0.015) sun_orbit(latitude, 0.75, 0.015) } object { ground translate -0.001*z } no_shadow } intersection { heavens() object { ground } } #include "coord-axes.inc" coord_axes(1.25) #declare camera_ctr = < 00.000, 00.000, 0.500 >; #declare camera_dir = < +7.000, -5.000, +3.500 >; #declare camera_dst = 9.0; #declare camera_upp = z; #declare scene_radius = 1.200; #include "camera.inc"