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
758c5cd2
Commit
758c5cd2
authored
5 months ago
by
Percen
Browse files
Options
Download
Email Patches
Plain Diff
Update public/index.html
parent
e8e70361
master
21caog1bif-master-patch-96693
1 merge request
!97
Update public/index.html
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/index.html
+7
-4
public/index.html
with
7 additions
and
4 deletions
+7
-4
public/index.html
+
7
-
4
View file @
758c5cd2
...
@@ -156,8 +156,8 @@
...
@@ -156,8 +156,8 @@
<div
class=
"menu-item"
id=
"exit-item"
onclick=
"exitAR()"
>
<div
class=
"menu-item"
id=
"exit-item"
onclick=
"exitAR()"
>
<img
src=
"previewImages/exit.png"
alt=
"Exit"
style=
"width: 50px; height: 50px;"
>
<img
src=
"previewImages/exit.png"
alt=
"Exit"
style=
"width: 50px; height: 50px;"
>
</div>
</div>
</div>
</div>
<div
id=
"confirmation-dialog"
style=
"display: none;"
>
<div
id=
"confirmation-dialog"
style=
"display: none;"
>
<div
class=
"dialog-overlay"
></div>
<div
class=
"dialog-overlay"
></div>
<div
class=
"dialog-box"
>
<div
class=
"dialog-box"
>
...
@@ -166,6 +166,7 @@
...
@@ -166,6 +166,7 @@
<button
onclick=
"confirmExit(false)"
>
Nein
</button>
<button
onclick=
"confirmExit(false)"
>
Nein
</button>
</div>
</div>
</div>
</div>
<script>
<script>
let
selectedModel
=
'
robot
'
;
// Start mit dem Roboter
let
selectedModel
=
'
robot
'
;
// Start mit dem Roboter
let
models
=
{};
let
models
=
{};
...
@@ -212,12 +213,16 @@
...
@@ -212,12 +213,16 @@
loader
.
load
(
"
https://threejs.org/examples/models/gltf/RobotExpressive/RobotExpressive.glb
"
,
(
gltf
)
=>
{
loader
.
load
(
"
https://threejs.org/examples/models/gltf/RobotExpressive/RobotExpressive.glb
"
,
(
gltf
)
=>
{
models
.
robot
=
gltf
.
scene
;
models
.
robot
=
gltf
.
scene
;
});
});
loader
.
load
(
"
https://immersive-web.github.io/webxr-samples/media/gltf/sunflower/sunflower.gltf
"
,
(
gltf
)
=>
{
loader
.
load
(
"
https://immersive-web.github.io/webxr-samples/media/gltf/sunflower/sunflower.gltf
"
,
(
gltf
)
=>
{
models
.
sunflower
=
gltf
.
scene
;
models
.
sunflower
=
gltf
.
scene
;
});
});
// Lantern Model laden und skalieren
loader
.
load
(
"
https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Assets/refs/heads/main/Models/Lantern/glTF/Lantern.gltf
"
,
(
gltf
)
=>
{
loader
.
load
(
"
https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Assets/refs/heads/main/Models/Lantern/glTF/Lantern.gltf
"
,
(
gltf
)
=>
{
models
.
tree
=
gltf
.
scene
;
models
.
tree
=
gltf
.
scene
;
// Skaliere das Modell kleiner
models
.
tree
.
scale
.
set
(
0.3
,
0.3
,
0.3
);
// Skaliert das Modell auf 50% der Originalgröße
});
});
// AR-Session starten
// AR-Session starten
...
@@ -253,7 +258,6 @@
...
@@ -253,7 +258,6 @@
if
(
models
[
selectedModel
])
{
if
(
models
[
selectedModel
])
{
const
clone
=
models
[
selectedModel
].
clone
();
const
clone
=
models
[
selectedModel
].
clone
();
clone
.
position
.
copy
(
reticle
.
position
);
clone
.
position
.
copy
(
reticle
.
position
);
clone
.
scale
.
set
(
0.5
,
0.5
,
0.5
);
// Größe anpassen
scene
.
add
(
clone
);
scene
.
add
(
clone
);
console
.
log
(
`
${
selectedModel
}
platziert`
);
console
.
log
(
`
${
selectedModel
}
platziert`
);
}
}
...
@@ -324,7 +328,6 @@
...
@@ -324,7 +328,6 @@
}
else
{
}
else
{
alert
(
'
WebXR wird nicht unterstützt.
'
);
alert
(
'
WebXR wird nicht unterstützt.
'
);
}
}
</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