// Camera placement for the MP logo // Last edited on 2010-03-31 11:54:18 by stolfi #macro put_camera(focus,wd,ht,dir,dist,upp) // focus = point of interest in scene. // wd = nominal width of scene around {focus}. // ht = nominal height of scene around {focus}. // dir = direction of camera from {focus} (length is immaterial). // dist = distance from focus along {dir}. // upp = sky direction. // If {dist = 0} the camera is #local udir = vnormalize(dir); #local pos = focus + dist * udir; #local slop = 1.10; #if (wd/image_width > ht/image_height) #local cwd = wd/dist; #local cht = cwd*image_height/image_width; #else #local cht = ht/dist; #local cwd = cht*image_width/image_height; #end camera { location pos right - slop * cwd * x up + slop * cht * y sky upp look_at focus } #end