// Last edited on 2010-05-15 20:57:31 by stolfilocal // SARACCHINI'S CAMERA ///////////////////////////////////// // The camera's body: #declare camera_device_body_szX = 44; #declare camera_device_body_szY = 44; #declare camera_device_body_szZ = 82; // The camera's lens: #declare camera_device_lens_len = 50; #declare camera_device_lens_rad = 20; // The camera holder dimensions (after rotation): #declare camera_device_holder_thk = 3; // Thickness. #declare camera_device_holder_szX = 100; // Length of rig-side arm. #declare camera_device_holder_szY = 55; // width of device platform. #declare camera_device_holder_szZ = 90; // Length of device platform. #declare camera_device_holder_wdt = 25; // Width of rig-side arm. #declare camera_device_holder_hole1_dst = 40; // From corner. #declare camera_device_holder_hole2_dst = 20; // From tip. // Camra holder position relative to center of camera's backside: #declare camera_device_holder_dpX = camera_device_body_szX/2; #declare camera_device_holder_dpY = camera_device_body_szY/2 - camera_device_holder_szY + camera_device_holder_thk; #declare camera_device_holder_dpZ = camera_device_body_szZ/2; #macro camera_device_body_width() // Y extent of camera. (camera_device_body_szY) #end #macro camera_device_body_height() // Z extent of camera. (camera_device_body_szZ) #end #macro camera_device_focal_Z() // Dist from back of camera to the nominal pinhole. (camera_device_body_szZ + 0.5*camera_device_lens_len) #end #macro camera_device() // Camera points UP with the optical axis equal to the Z axis. // The back side of the camera is at Z = 0. // The equvalent pinhole is on the Z axis at {Z = camera_device_focal_Z()}. // The bottom side faces towards +X. #local body_szX = camera_device_body_szX; #local body_szY = camera_device_body_szY; #local body_szZ = camera_device_body_szZ; #local lens_len = camera_device_lens_len; #local lens_rad = camera_device_lens_rad; union{ box{ < -body_szX/2+eps, -body_szY/2+eps, 0 >, < +body_szX/2-eps, +body_szY/2-eps, body_szZ > texture{ tx_camera_body } } cylinder{ < 0, 0, 0-eps >, < 0, 0, lens_len-eps >, lens_rad-eps texture{ tx_camera_lens_barrel } translate body_szZ*z } } #end #macro camera_device_with_holder(hrad) // Camera positioned as in {camera_device}. // The holder is attached to the bottom side with the // rig attachment tongue on the -Y side and parallel to the XZ plane. // Holder position after rotations: #local holder_dpX = camera_device_holder_dpX; #local holder_dpY = camera_device_holder_dpY; #local holder_dpZ = camera_device_holder_dpZ; union{ object{ camera_device() } object{ device_holder( camera_device_holder_szY, camera_device_holder_szZ,camera_device_holder_szX, camera_device_holder_wdt, camera_device_holder_thk, hrad, camera_device_holder_hole1_dst, camera_device_holder_hole2_dst ) texture{ tx_steel } rotate +90*z rotate -90*y translate < holder_dpX, holder_dpY, holder_dpZ > } } #end