Created
August 17, 2016 20:16
-
-
Save Fabiantjoeaon/f0c3cd1c9f9c748df7df6fb13da6d25c to your computer and use it in GitHub Desktop.
Three on window resize
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
function onWindowResize() { | |
windowHalfX = window.innerWidth / 2; | |
windowHalfY = window.innerHeight / 2; | |
camera.aspect = window.innerWidth / window.innerHeight; | |
camera.updateProjectionMatrix(); | |
renderer.setSize( window.innerWidth, window.innerHeight ); | |
} | |
window.addEventListener( 'resize', onWindowResize, false ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment