Skip to content

Instantly share code, notes, and snippets.

@turbodrive
Last active September 19, 2015 12:46
Show Gist options
  • Save turbodrive/dede2748fadb7e8dfb13 to your computer and use it in GitHub Desktop.
Save turbodrive/dede2748fadb7e8dfb13 to your computer and use it in GitHub Desktop.
Formula to get the CSS Perspective value from the focal length and viewport size
var viewportWidth = 1280;
var focalLength = 28;
var filmWidth = 36;
var cssPerspective = viewportWidth / (filmWidth/focalLength);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment