Commit b243f6c5 authored by Rahman's avatar Rahman
Browse files

Update index.html

parent 93a40df9
Pipeline #9759 passed with stage
in 6 seconds
......@@ -60,42 +60,22 @@ async function activateXR() {
const loader = new THREE.GLTFLoader();
let reticle;
// Load the reticle model
loader.load(
"https://immersive-web.github.io/webxr-samples/media/gltf/reticle/reticle.gltf",
function (gltf) {
reticle = gltf.scene;
reticle.visible = false;
scene.add(reticle);
console.log("Reticle loaded successfully");
},
undefined,
function (error) {
console.error("Error loading reticle:", error);
}
);
loader.load("https://immersive-web.github.io/webxr-samples/media/gltf/reticle/reticle.gltf", function(gltf) {
reticle = gltf.scene;
reticle.visible = false;
scene.add(reticle);
});
let beeModel;
// Load the bee model with the correct URL
loader.load(
"https://transfer.hft-stuttgart.de/gitlab/22raya1mpg/argumented-reality/-/raw/567d6ba4fbd43ce81686043298a1f324485a9630/bee/scene.gltf",
function (gltf) {
beeModel = gltf.scene;
console.log("Bee model loaded successfully");
},
undefined,
function (error) {
console.error("Error loading bee model:", error);
}
);
loader.load("https://transfer.hft-stuttgart.de/gitlab/22raya1mpg/argumented-reality/-/raw/567d6ba4fbd43ce81686043298a1f324485a9630/bee/scene.gltf", function(gltf) {
beeModel = gltf.scene;
});
session.addEventListener("select", (event) => {
if (beeModel && reticle) {
const clone = beeModel.clone();
clone.position.copy(reticle.position);
scene.add(clone);
console.log("Bee model placed at reticle position");
}
});
......@@ -128,7 +108,6 @@ async function activateXR() {
reticle.visible = true;
reticle.position.set(hitPose.transform.position.x, hitPose.transform.position.y, hitPose.transform.position.z);
reticle.updateMatrixWorld(true);
console.log("Reticle position updated");
}
// Render the scene with THREE.WebGLRenderer.
......
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