yskang

threejs-get-started-6

Apr 15th, 2020
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. // Start rendering
  2.  
  3. //... Other code snippet
  4. window.addEventListener( 'resize', function() {
  5. camera.aspect = window.innerWidth / window.innerHeight;
  6.  
  7. camera.updateProjectionMatrix();
  8.  
  9. renderer.setSize( window.innerWidth, window.innerHeight );
  10. });
Advertisement
Add Comment
Please, Sign In to add comment