Skip to content

Instantly share code, notes, and snippets.

@turbodrive
Last active August 29, 2015 14:07
Show Gist options
  • Save turbodrive/cb9cfc011655f3c6e52b to your computer and use it in GitHub Desktop.
Save turbodrive/cb9cfc011655f3c6e52b to your computer and use it in GitHub Desktop.
Formula to convert After Effects to Three.js camera focal length
/* 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