I'm working on a camera importer for Maya and the source cameras provide only projection/view matrices and FOV (field of view) values.
In Maya FOV/AOV is a derived attribute of the horizontal film aperture and focal length rather than an attribute of the camera. Maya uses the following equation to determine FOV:
CODE
proc float AEcalculateFOV( string $focalStr, string $horStr )
{
float $focal = getAttr $focalStr;
float $aperture = getAttr $horStr;
float $fov = (0.5 * $aperture) / ($focal * 0.03937);
$fov = 2.0 * atan ($fov);
$fov = 57.29578 * $fov;
return $fov;
}
Maya also provides a solution to getting the focal length given FOV and horizontal film aperture:
CODE
global proc AEadjustFocal( string $focalStr, string $horStr )
{
float $fov = floatSliderGrp -q -value fovGrp;
float $aperture = getAttr $horStr;
float $focal = tan (0.00872665 * $fov);
$focal = (0.5 * $aperture) / ($focal * 0.03937);
setAttr $focalStr $focal;
}
If all I know about a camera is its FOV, How do I calculate both the horizontal film aperture and focal length?
Thanks in advance.