Make sure all examples resize when the window is resized (#155)

This commit is contained in:
Noeri Huisman
2025-09-15 23:38:16 +02:00
committed by GitHub
parent 8f340d1f78
commit 882def6eb7
19 changed files with 129 additions and 17 deletions
+7
View File
@@ -33,6 +33,13 @@
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
window.addEventListener('resize', onWindowResize, false);
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
}
// Cat model setup
const splatURL = await getAssetFileURL("cat.spz");
const cat = new SplatMesh({ url: splatURL });