// Last edited on 2010-05-31 23:55:15 by stolfilocal // Simulated stage view from camera (various lightings) global_settings { assumed_gamma 2.2 } #declare eps = 0.001; // Skosh to keep surfaces from touching. background { color rgb <1.000, 1.000, 1.000> } #include "pst_axes.inc" #include "pst_textures.inc" #include "pst_stage.inc" #include "pst_camera_rig.inc" #include "pst_test_scenes.inc" #declare scene_type = scene_mask; // Type of sample scene. #declare max_light_incl = 45; // Max nominal light inclination. #declare max_subj_wdt = 200; // Max X and Y extent of subject. #declare max_subj_hgt = 50; // Max Z extent of subject. #declare camera_height = 2000; // From floor to pinhole. #declare camera_reach = 500; // From axis of rig base to pinhole. // !!! Should compute these from the lens's focal length. !!! // Seems right for 25mm lens, Pike F-100 camera. #declare camera_rel_szX = 0.2727; // Viewfield width/distance. #declare camera_rel_szY = 0.2727; // Viewfield height/distance. #declare stage_foot_hgt = 0; // Height of stage feet (0 if none). #declare stage_handle_pos = stage_plate_szX/2 - 15; // Position of handles. #declare scene = union{ object{ camera_rig_base(false) } union{ object{ stage( stage_foot_hgt, stage_handle_pos, max_subj_wdt, max_subj_hgt, scene_type, max_light_incl, false ) } object{ test_blocks(true) scale max_subj_wdt/2 translate (stage_foot_hgt + stage_plate_thk + 0.5)*z } rotate 90*z translate camera_reach*x } } #debug "built scene\n" #declare scene_min = min_extent(scene); #declare scene_max = max_extent(scene); object{ scene } // object{ axes(1.5,600) no_shadow } #debug "instantiated scene\n" // Dimensions and position of camera field of view on the floor: #local cam_ctr = camera_reach*x; #local cam_szX = camera_rel_szX * camera_height; #local cam_szY = camera_rel_szY * camera_height; #declare viewAzim = 0.0; #declare viewElev = 90.0; #declare viewDist = camera_height; #declare viewRadius = sqrt(cam_szX*cam_szX + cam_szY*cam_szY)/2; #declare viewCenter = cam_ctr; #declare viewSky = -x; #debug "defined the view parameters\n" #include "pst_camlight.inc" camlight(viewCenter, viewAzim, viewElev, viewDist, viewRadius, viewSky, 2, 0.00) #macro lantern(azim,incl,dist,angrad,lux) #local mxincl = max_light_incl - angrad; #local elev = 90 - min(incl, mxincl); object{ camlight_lamp_array(3,angrad,lux) rotate 360*(sqrt(5)-1)/2*x scale dist rotate -elev*y rotate azim*z translate cam_field_ctr } #end