From be08d91de289407420a8e1825d784bc2fe1d0bb1 Mon Sep 17 00:00:00 2001
From: Rafiei <32rafa1mpg@hft-stuttgart.de>
Date: Mon, 17 Jun 2024 19:26:20 +0000
Subject: [PATCH] Update index.html

---
 public/index.html | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/public/index.html b/public/index.html
index 569b771..3e9ce6c 100644
--- a/public/index.html
+++ b/public/index.html
@@ -39,6 +39,21 @@ const cube = new THREE.Mesh(new THREE.BoxBufferGeometry(0.2, 0.2, 0.2), material
 cube.position.set(1, 1, 1);
 scene.add(cube);
 
+// Set up the WebGLRenderer, which handles rendering to the session's base layer.
+const renderer = new THREE.WebGLRenderer({
+  alpha: true,
+  preserveDrawingBuffer: true,
+  canvas: canvas,
+  context: gl
+});
+renderer.autoClear = false;
+
+// The API directly updates the camera matrices.
+// Disable matrix auto updates so three.js doesn't attempt
+// to handle the matrices independently.
+const camera = new THREE.PerspectiveCamera();
+camera.matrixAutoUpdate = false;
+
 }
 </script>
 </body>
-- 
GitLab