// Last edited on 2022-07-24 00:32:32 by stolfi #macro camera_parameters(thing, clk) // Globally defines the {camlight} parameters {scene_center}, // {scene_radius}, {dir_camera}, and {dist_camera} for the view of // object {thing} for the movie clock {clk}. #local thpos = min_extent(thing); #local thdim = max_extent(thing) - thpos; #debug concat("\n!! thpos = ", vstr(3, thpos, " ", 0,1), " thdim = ", vstr(3, thdim, " ", 0,1), "\n") #local thrad = vlength(thdim)/2; #local thctr = thpos + thdim/2; #local azim = 4*pi*clk; #local elev = 0.5*pi*(0.20 - 0.15*cos(0.5*azim)); #declare scene_center = thctr; #declare scene_radius = 1.5*thrad; #declare dir_camera = < cos(azim)*cos(elev), sin(azim)*cos(elev), sin(elev) >; #declare dist_camera = 5*scene_radius; #end