From 58ecc3f535544638405778b705c7b183743b4c69 Mon Sep 17 00:00:00 2001 From: Percen <21pesi1bif@hft-stuttgart.de> Date: Sun, 8 Dec 2024 21:17:07 +0000 Subject: [PATCH] Update public/index.html --- public/index.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/index.html b/public/index.html index 4c1973c..a24508f 100644 --- a/public/index.html +++ b/public/index.html @@ -51,6 +51,15 @@ renderer.autoClear = false; // to handle the matrices independently. const camera = new THREE.PerspectiveCamera(); camera.matrixAutoUpdate = false; +// Initialize a WebXR session using "immersive-ar". +const session = await navigator.xr.requestSession("immersive-ar"); +session.updateRenderState({ + baseLayer: new XRWebGLLayer(session, gl) +}); + +// A 'local' reference space has a native origin that is located +// near the viewer's position at the time the session was created. +const referenceSpace = await session.requestReferenceSpace('local'); } </script> -- GitLab