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
Esguerra Montana
WebarTTP
Commits
c652dbd0
Commit
c652dbd0
authored
10 months ago
by
Esguerra Montana
Browse files
Options
Download
Email Patches
Plain Diff
Update index.html
parent
a6ecee74
Pipeline
#9651
passed with stage
in 13 seconds
Changes
1
Pipelines
1
Hide 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 @
c652dbd0
...
@@ -60,8 +60,6 @@ const viewerSpace = await session.requestReferenceSpace('viewer');
...
@@ -60,8 +60,6 @@ const viewerSpace = await session.requestReferenceSpace('viewer');
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,15 +68,15 @@ loader.load("https://immersive-web.github.io/webxr-samples/media/gltf/reticle/re
...
@@ -70,15 +68,15 @@ loader.load("https://immersive-web.github.io/webxr-samples/media/gltf/reticle/re
scene
.
add
(
reticle
);
scene
.
add
(
reticle
);
})
})
let
chair
;
let
antique
;
loader
.
load
(
"
./antiqueCamera/AntiqueCamera.gltf
"
,
function
(
gltf
)
{
loader
.
load
(
"
./antiqueCamera/AntiqueCamera.gltf
"
,
function
(
gltf
)
{
chair
=
gltf
.
scene
;
antique
=
gltf
.
scene
;
chair
.
scale
.
set
(
0.15
,
0.15
,
0.15
);
antique
.
scale
.
set
(
0.15
,
0.15
,
0.15
);
});
});
session
.
addEventListener
(
"
select
"
,
(
event
)
=>
{
session
.
addEventListener
(
"
select
"
,
(
event
)
=>
{
if
(
chair
)
{
if
(
antique
)
{
const
clone
=
chair
.
clone
();
const
clone
=
antique
.
clone
();
clone
.
position
.
copy
(
reticle
.
position
);
clone
.
position
.
copy
(
reticle
.
position
);
scene
.
add
(
clone
);
scene
.
add
(
clone
);
}
}
...
@@ -113,9 +111,7 @@ const onXRFrame = (time, frame) => {
...
@@ -113,9 +111,7 @@ const onXRFrame = (time, frame) => {
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
);
}
}
// Render the scene with THREE.WebGLRenderer.
// Render the scene with THREE.WebGLRenderer.
renderer
.
render
(
scene
,
camera
)
renderer
.
render
(
scene
,
camera
)
...
@@ -123,9 +119,6 @@ const onXRFrame = (time, frame) => {
...
@@ -123,9 +119,6 @@ const onXRFrame = (time, frame) => {
}
}
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
Menu
Explore
Projects
Groups
Snippets