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
GeoVistoogsi
AR
Commits
f788fc24
Commit
f788fc24
authored
4 months ago
by
Percen
Browse files
Options
Download
Email Patches
Plain Diff
Update public/index.html
parent
3028093e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/index.html
+4
-15
public/index.html
with
4 additions
and
15 deletions
+4
-15
public/index.html
+
4
-
15
View file @
f788fc24
...
...
@@ -24,7 +24,7 @@
</head>
<body>
<script>
let
selectedModel
=
'
car
'
;
// Standardauswahl
let
selectedModel
=
'
robot
'
;
// Standardauswahl
let
models
=
{};
let
reticle
;
...
...
@@ -54,10 +54,10 @@
// Modelle laden
loader
.
load
(
"
https://threejs.org/examples/models/gltf/RobotExpressive/RobotExpressive.glb
"
,
(
gltf
)
=>
{
models
.
car
=
gltf
.
scene
;
models
.
robot
=
gltf
.
scene
;
});
loader
.
load
(
"
https://immersive-web.github.io/webxr-samples/media/gltf/sunflower/sunflower.gltf
"
,
(
gltf
)
=>
{
models
.
lamp
=
gltf
.
scene
;
models
.
flower
=
gltf
.
scene
;
});
// AR-Session starten
...
...
@@ -69,18 +69,7 @@
session
.
requestAnimationFrame
(
onXRFrame
);
session
.
addEventListener
(
"
select
"
,
(
event
)
=>
{
if
(
!
reticle
)
return
;
// Kein Button getroffen -> Modell platzieren
if
(
models
[
selectedModel
])
{
const
clone
=
models
[
selectedModel
].
clone
();
clone
.
position
.
copy
(
reticle
.
position
);
clone
.
scale
.
set
(
0.5
,
0.5
,
0.5
);
// Größe anpassen
scene
.
add
(
clone
);
console
.
log
(
`
${
selectedModel
}
platziert`
);
}
});
// AR-Rendering
function
onXRFrame
(
time
,
frame
)
{
...
...
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