From 89808da826c20a1cfb8c03054483f0e5f8cf669c Mon Sep 17 00:00:00 2001 From: Avaer Kazmer Date: Mon, 4 Nov 2019 23:43:33 -0500 Subject: [PATCH] Update aspect ratio on resize --- index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.html b/index.html index 9eedb51..acecda1 100644 --- a/index.html +++ b/index.html @@ -371,6 +371,11 @@

Examples

const model = await ModelLoader.loadModelUrl(url); _setLocalModel(model); })(); + +window.addEventListener('resize', e => { + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); +});