Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Rahman
Argumented Reality
Commits
93a40df9
Commit
93a40df9
authored
Jun 20, 2024
by
Rahman
Browse files
Update index.html
parent
567d6ba4
Pipeline
#9758
passed with stage
in 6 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
public/index.html
View file @
93a40df9
...
...
@@ -60,22 +60,42 @@ async function activateXR() {
const
loader
=
new
THREE
.
GLTFLoader
();
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
.
visible
=
false
;
scene
.
add
(
reticle
);
});
console
.
log
(
"
Reticle loaded successfully
"
);
},
undefined
,
function
(
error
)
{
console
.
error
(
"
Error loading reticle:
"
,
error
);
}
);
let
beeModel
;
loader
.
load
(
"
https://transfer.hft-stuttgart.de/gitlab/22raya1mpg/argumented-reality/-/blob/master/bee/scene.gltf
"
,
function
(
gltf
)
{
// 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
);
}
);
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
"
);
}
});
...
...
@@ -108,6 +128,7 @@ 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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment