// Last edited on 2011-05-11 02:55:34 by stolfi // Generic figure of whole Fukushima Daiichi reactors. #include "coord_axes.inc" #include "lamp_array.inc" #include "camlight.inc" #include "cutters.inc" #include "generic_parts.inc" #include "human.inc" #include "textures.inc" #macro generic_fig(OB,view,cam_mag) // Generic figure of object {OB}. // To be called at top-level of ".pov" file. // Positions the camera and lights. // {view} = // 0 = caller must define {cam_dir,cam_dst,cam_upp} // 1 = from south looking north. // 2 = from east looking west. // 3 = from SE above. // 4 = from above looking down. // 5 = from SE almost above. // 6 = from S almost above. // 7 = from W almost above. // If {view} is nonzero, selects {cam_dir}, {cam_dst}, // {cam_upp} based on view; otherwise // the caller must define them. // If {cam_mag} is nonzero, computes {cam_rad} and {cam_ctr} // to fit the scene in the window, then divides {cam_rad} // by {cam_mag}. If {cam_rad} is zero, the caller must // define {cam_rad} and {cam_ctr}. // Choose the cutter and camera placement: #if (view = 1) #declare cam_dir = -y; // From south looking north. #declare cam_dst = 5000; #declare cam_upp = +z; #end #if (view = 2) #declare cam_dir = +x; // From east looking west. #declare cam_dst = 5000; #declare cam_upp = +z; #end #if (view = 3) #declare cam_dir = <5,-4,3>; #declare cam_dst = 0; // Decide later. #declare cam_upp = +z; #end #if (view = 4) #declare cam_dir = +z; // From above looking down. #declare cam_dst = 5000; #declare cam_upp = +y; #end #if (view = 5) #declare cam_dir = <5,-4,10>; // From above looking down. #declare cam_dst = 0; // Define later based on {cam_rad}. #declare cam_upp = +z; #end #if (view = 6) #declare cam_dir = <1,-10,7>; // From nearly west. #declare cam_dst = 0; // Define later based on {cam_rad}. #declare cam_upp = +z; #end #if (view = 7) #declare cam_dir = <10,-2,7>; // From nearly north. #declare cam_dst = 0; // Define later based on {cam_rad}. #declare cam_upp = +z; #end #local lo_corner = min_extent(OB); #local hi_corner = max_extent(OB); debug_point("lo_corner", lo_corner) debug_point("hi_corner", hi_corner) #if (cam_mag > 0) #declare cam_ctr = (lo_corner + hi_corner)/2; #declare cam_rad = (1.4/cam_mag)*vlength(hi_corner - lo_corner)/2; #end #if ((view = 1) | (view = 2) | (view = 4)) // Near-black background, camera-centered lighting: background{ color rgb < 0.010, 0.010, 0.040 > } #declare cam_lux = 1.0; #declare cam_lnr = 2; #declare cam_lar = 5.0; #declare cam_lct = 1; #local scene = object{ OB } #else // Blue-gray background, off-camera lighting: background{ color rgb < 0.200, 0.210, 0.240 > } #declare cam_lux = 1.2; #declare cam_lnr = 2; #declare cam_lar = 25.0; #declare cam_lct = 0; #local scene = union{ // object{ sky() } object{ OB } // object{ coord_axes(cam_rad) } } #end #if (cam_dst <= 0) #declare cam_dst = 8*cam_rad; #end object{ scene } camlight(cam_ctr,cam_rad,cam_dir,cam_dst,cam_upp, cam_lux,cam_lnr,cam_lar,cam_lct) #end