From ce44dc7d00f225c4ce3f2f1347406c41c91eb809 Mon Sep 17 00:00:00 2001 From: Rahman <22raya1mpg@hft-stuttgart.de> Date: Sat, 8 Jun 2024 10:20:51 +0000 Subject: [PATCH] Update index.html --- public/index.html | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/public/index.html b/public/index.html index d553fa4..b8be792 100644 --- a/public/index.html +++ b/public/index.html @@ -70,14 +70,14 @@ loader.load("https://immersive-web.github.io/webxr-samples/media/gltf/reticle/re scene.add(reticle); }) -let rabbit; -loader.load("https://immersive-web.github.io/webxr-samples/media/gltf/rabbit/scene.gltf", function(gltf) { - rabbit = gltf.scene; +let flower; +loader.load("https://immersive-web.github.io/webxr-samples/media/gltf/sunflower/sunflower.gltf", function(gltf) { + flower = gltf.scene; }); session.addEventListener("select", (event) => { - if (rabbit) { - const clone = rabbit.clone(); + if (flower) { + const clone = flower.clone(); clone.position.copy(reticle.position); scene.add(clone); } @@ -115,3 +115,17 @@ const onXRFrame = (time, frame) => { } + + // Render the scene with THREE.WebGLRenderer. + renderer.render(scene, camera) + } +} +session.requestAnimationFrame(onXRFrame); + + + + +} +</script> +</body> +</html> -- GitLab