Skip to content

Instantly share code, notes, and snippets.

@gidili
Created June 9, 2015 13:18
Show Gist options
  • Save gidili/57b14da1d47c410209e6 to your computer and use it in GitHub Desktop.
Save gidili/57b14da1d47c410209e6 to your computer and use it in GitHub Desktop.
// Resize canvas when the user manually resizes window
window.addEventListener('resize', function () {
var width = $container.width();
var height = $container.height();
camera.aspect = (width) / (height);
camera.updateProjectionMatrix();
renderer.setSize(width, height);
render();
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment