カメラの、画角(Angle of View)、被写界深度(Focal Length)、撮像面サイズ(Camera Aperture)の関係が、少々ややこしい。
・Camera Aperture(Horizontal) をいじると、Focal Length 固定で Angle of View が変化
・Focal Length と Angle of View はお互いをいじると、その互いの値が変化
となっている。
この計算は
C:\Program Files\Autodesk\MayaX.X\scripts\AETemplates
AEcameraTemplate.mel
というスクリプトのプロシージャ
AEcalculateFOV (Angle of View の算出)
float $focal = `getAttr $focalStr`; //Focal Length値
float $aperture = `getAttr $horStr`; //横Camera AZperture値
float $fov = (0.5 * $aperture) / ($focal * 0.03937);
$fov = 2.0 * atan ($fov);
$fov = 57.29578 * $fov; //Angle of View値
AEadjustFocal (Focal length の算出)
float $fov = `floatSliderGrp -q -value fovGrp`; //Angle of View値
float $aperture = `getAttr $horStr`; //横Camera AZperture値
float $focal = tan (0.00872665 * $fov);
$focal = (0.5 * $aperture) / ($focal * 0.03937); //Focal length値
で計算されています。各定数は
0.03937 : Focal Lengthのミリ数-インチ換算(Camera Apertureはインチなので)
57.29578 : 角度-ラジアン変換
0.00872665は、1/(57.29578*2)
ですね。
PR