Last active
September 19, 2015 12:46
-
-
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
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
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