Last active
August 29, 2015 14:07
-
-
Save turbodrive/cb9cfc011655f3c6e52b to your computer and use it in GitHub Desktop.
Formula to convert After Effects to Three.js camera focal length
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* aeFocalLength must be in millimeters */ | |
var getThreeFocalLength = function(viewportWidth, viewportHeight, aeFocalLength, filmWidth, filmHeight) { | |
if ( filmWidth === undefined ) filmWidth = 36; | |
if ( filmHeight === undefined ) filmHeight = 24; | |
return (filmHeight*(viewportWidth / (filmWidth/aeFocalLength)))/viewportHeight; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment