From c7ceb47970545c6afd76359b2dc1d287fbe5defb Mon Sep 17 00:00:00 2001
From: Percen <21pesi1bif@hft-stuttgart.de>
Date: Sun, 8 Dec 2024 21:15:39 +0000
Subject: [PATCH] Update public/index.html

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

diff --git a/public/index.html b/public/index.html
index 67dcf4f..4c1973c 100644
--- a/public/index.html
+++ b/public/index.html
@@ -37,6 +37,20 @@ const materials = [
 const cube = new THREE.Mesh(new THREE.BoxBufferGeometry(0.2, 0.2, 0.2), materials);
 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>
-- 
GitLab