Skip to content

Instantly share code, notes, and snippets.

@jeromeetienne
Created March 20, 2011 11:43
Show Gist options
  • Save jeromeetienne/878286 to your computer and use it in GitHub Desktop.
Save jeromeetienne/878286 to your computer and use it in GitHub Desktop.
if(typeof THREEx === "undefined") var THREEx = {};
THREEx.windowResize = function(renderer, camera){
this.callback = function(){
renderer.setSize( window.innerWidth, window.innerHeight );
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix()
}
window.addEventListener('resize', this.callback);
return {
unbind : function(){
window.removeEventListener('resize', this.callback);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment