From 73057d5a2e458e809b762d04d32153b8e8bbae11 Mon Sep 17 00:00:00 2001 From: Riegel <22rial1mpg@hft-stuttgart.de> Date: Sat, 17 Jun 2023 15:00:04 +0000 Subject: [PATCH] Update public/index.html --- public/index.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/public/index.html b/public/index.html index db8a4e4..5b979d9 100644 --- a/public/index.html +++ b/public/index.html @@ -53,6 +53,17 @@ renderer.autoClear = false; 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