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