Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Convert AOV from Focal Length / Focal Length from AOV (Maya)
# Mayaで諸事情によりカメラスケール使えなかった時用に調べて書いた
# degreeとmmで計算してます
import math
def focal_to_aov(focal, aperture):
focal: focal length
aperture: horizontal aperture (mm)
return math.degrees(2.0*math.atan((aperture*0.5)/focal))
def aov_to_focal(aov, aperture):
aov: angle of view (degree)
aperture: horizontal aperture (mm)
return 1.0/(math.tan(math.radians(aov*0.5))/aperture)*0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.