Last active
July 24, 2020 02:14
-
-
Save yiwenl/ed1cc6f6f8605b254efd9203d16c7a85 to your computer and use it in GitHub Desktop.
This file contains 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
// fov in Radians, camera position in [x, y, z] | |
const fovHeight = Math.tan(camera.fov / 2) * camera.position[2] | |
const fovWidth = fovHeight * camera.aspectRatio |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment