Created
January 1, 2016 05:11
-
-
Save AndrewRayCode/10d7840f8d3aff0892ac to your computer and use it in GitHub Desktop.
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
| function getFrustrumAt( camera, fov, aspect, distanceFromCamera ) { | |
| var frustumHeight = 2.0 * distanceFromCamera * Math.tan(fov * 0.5 * ( Math.PI / 180 ) ), | |
| var box = new THREE.Box2(); | |
| var size = new THREE.Vector2( frustumHeight * aspect, frustumHeight ); | |
| box.width = size.x; | |
| box.height = size.y; | |
| return box.setFromCenterAndSize( camera.position, new THREE.Vector2( | |
| frustumHeight * aspect | |
| frustumHeight | |
| )); | |
| }; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment