Skip to content

Commit

Permalink
Update aspect ratio on resize
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaer Kazmer committed Nov 5, 2019
1 parent c8ae400 commit 89808da
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ <h3>Examples</h3>
const model = await ModelLoader.loadModelUrl(url);
_setLocalModel(model);
})();

window.addEventListener('resize', e => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
});
</script>
</body>
</html>

0 comments on commit 89808da

Please sign in to comment.