Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yiwenl
Last active July 24, 2020 02:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yiwenl/ed1cc6f6f8605b254efd9203d16c7a85 to your computer and use it in GitHub Desktop.
Save yiwenl/ed1cc6f6f8605b254efd9203d16c7a85 to your computer and use it in GitHub Desktop.
// 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