Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Esguerra Montana
WebarTTP
Commits
9ace2bae
Commit
9ace2bae
authored
11 months ago
by
Esguerra Montana
Browse files
Options
Download
Email Patches
Plain Diff
Update index.html
parent
693b705d
Pipeline
#9616
passed with stage
in 8 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/index.html
+6
-13
public/index.html
with
6 additions
and
13 deletions
+6
-13
public/index.html
+
6
-
13
View file @
9ace2bae
...
@@ -59,9 +59,6 @@ const viewerSpace = await session.requestReferenceSpace('viewer');
...
@@ -59,9 +59,6 @@ const viewerSpace = await session.requestReferenceSpace('viewer');
// Perform hit testing using the viewer as origin.
// Perform hit testing using the viewer as origin.
const
hitTestSource
=
await
session
.
requestHitTestSource
({
space
:
viewerSpace
});
const
hitTestSource
=
await
session
.
requestHitTestSource
({
space
:
viewerSpace
});
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
)
{
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
...
@@ -70,16 +67,17 @@ loader.load("https://immersive-web.github.io/webxr-samples/media/gltf/reticle/re
scene
.
add
(
reticle
);
scene
.
add
(
reticle
);
})
})
let
chair
;
let
fox
;
loader
.
load
(
"
./fox/Fox.gltf
"
,
function
(
gltf
)
{
loader
.
load
(
"
./fox/Fox.gltf
"
,
function
(
gltf
)
{
chair
=
gltf
.
scene
;
fox
=
gltf
.
scene
;
chair
.
scale
.
set
(
0.
5
,
0.
5
,
0.
5
);
// Adjust the scale as needed
fox
.
scale
.
set
(
0.
1
,
0.
1
,
0.
1
);
// Adjust the scale as needed
});
});
session
.
addEventListener
(
"
select
"
,
(
event
)
=>
{
session
.
addEventListener
(
"
select
"
,
(
event
)
=>
{
if
(
chair
)
{
if
(
fox
)
{
const
clone
=
chair
.
clone
();
const
clone
=
fox
.
clone
();
clone
.
position
.
copy
(
reticle
.
position
);
clone
.
position
.
copy
(
reticle
.
position
);
clone
.
scale
.
set
(
0.1
,
0.1
,
0.1
);
// Ensure the clone is also scaled down
scene
.
add
(
clone
);
scene
.
add
(
clone
);
}
}
});
});
...
@@ -115,17 +113,12 @@ const onXRFrame = (time, frame) => {
...
@@ -115,17 +113,12 @@ const onXRFrame = (time, frame) => {
reticle
.
updateMatrixWorld
(
true
);
reticle
.
updateMatrixWorld
(
true
);
}
}
// Render the scene with THREE.WebGLRenderer.
// Render the scene with THREE.WebGLRenderer.
renderer
.
render
(
scene
,
camera
)
renderer
.
render
(
scene
,
camera
)
}
}
}
}
session
.
requestAnimationFrame
(
onXRFrame
);
session
.
requestAnimationFrame
(
onXRFrame
);
}
}
</script>
</script>
</body>
</body>
...
...
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