Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
10 months ago
by
Rahman
Browse files
Options
Download
Email Patches
Plain Diff
Update index.html
parent
567d6ba4
Pipeline
#9758
passed with stage
in 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/index.html
+29
-8
public/index.html
with
29 additions
and
8 deletions
+29
-8
public/index.html
+
29
-
8
View file @
93a40df9
...
@@ -60,22 +60,42 @@ async function activateXR() {
...
@@ -60,22 +60,42 @@ 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
)
{
reticle
=
gltf
.
scene
;
// Load the reticle model
reticle
.
visible
=
false
;
loader
.
load
(
scene
.
add
(
reticle
);
"
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
;
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
beeModel
=
gltf
.
scene
;
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
)
=>
{
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
"
);
}
}
});
});
...
@@ -108,6 +128,7 @@ async function activateXR() {
...
@@ -108,6 +128,7 @@ 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.
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets