Commit 9ace2bae authored by Esguerra Montana's avatar Esguerra Montana
Browse files

Update index.html

parent 693b705d
Pipeline #9616 passed with stage
in 8 seconds
......@@ -59,9 +59,6 @@ const viewerSpace = await session.requestReferenceSpace('viewer');
// Perform hit testing using the viewer as origin.
const hitTestSource = await session.requestHitTestSource({ space: viewerSpace });
const loader = new THREE.GLTFLoader();
let reticle;
loader.load("https://immersive-web.github.io/webxr-samples/media/gltf/reticle/reticle.gltf", function(gltf) {
......@@ -70,16 +67,17 @@ loader.load("https://immersive-web.github.io/webxr-samples/media/gltf/reticle/re
scene.add(reticle);
})
let chair;
let fox;
loader.load("./fox/Fox.gltf", function(gltf) {
chair = gltf.scene;
chair.scale.set(0.5, 0.5, 0.5); // Adjust the scale as needed
fox = gltf.scene;
fox.scale.set(0.1, 0.1, 0.1); // Adjust the scale as needed
});
session.addEventListener("select", (event) => {
if (chair) {
const clone = chair.clone();
if (fox) {
const clone = fox.clone();
clone.position.copy(reticle.position);
clone.scale.set(0.1, 0.1, 0.1); // Ensure the clone is also scaled down
scene.add(clone);
}
});
......@@ -115,17 +113,12 @@ const onXRFrame = (time, frame) => {
reticle.updateMatrixWorld(true);
}
// Render the scene with THREE.WebGLRenderer.
renderer.render(scene, camera)
}
}
session.requestAnimationFrame(onXRFrame);
}
</script>
</body>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment