Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GeoVistoogsi
AR
Commits
e3698fd5
Commit
e3698fd5
authored
Jan 02, 2025
by
Percen
Browse files
Update public/index.html
parent
92e572c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/index.html
View file @
e3698fd5
...
...
@@ -153,6 +153,9 @@
<div
class=
"menu-item"
id=
"lantern-item"
onclick=
"selectModel('tree')"
>
<img
src=
"previewImages/tree.png"
alt=
"Baum"
style=
"width: 50px; height: 50px;"
>
</div>
<div
class=
"menu-item"
id=
"zipModel-item"
onclick=
"selectModel('zipModel')"
>
<img
src=
"previewImages/zipModel.png"
alt=
"zipModel"
style=
"width: 50px; height: 50px;"
>
</div>
<div
class=
"menu-item"
id=
"exit-item"
onclick=
"exitAR()"
>
<img
src=
"previewImages/exit.png"
alt=
"Exit"
style=
"width: 50px; height: 50px;"
>
</div>
...
...
@@ -203,6 +206,30 @@
light
.
position
.
set
(
10
,
10
,
10
);
scene
.
add
(
light
);
// Dynamisches Laden eines Modells aus ZIP-Datei
const
status
=
document
.
getElementById
(
'
status
'
);
status
.
textContent
=
"
Lade Modell aus ZIP-Datei...
"
;
try
{
const
zipUrl
=
'
./assets/models/model.zip
'
;
// Relativer Pfad zur ZIP-Datei
const
files
=
await
loadAndUnpackZip
(
zipUrl
);
const
gltfFile
=
Object
.
keys
(
files
).
find
((
filename
)
=>
filename
.
endsWith
(
'
.gltf
'
));
if
(
!
gltfFile
)
{
throw
new
Error
(
'
Keine glTF-Datei in der ZIP gefunden.
'
);
}
loader
.
load
(
files
[
gltfFile
],
(
gltf
)
=>
{
const
zipModel
=
gltf
.
scene
;
zipModel
.
scale
.
set
(
0.5
,
0.5
,
0.5
);
// Skaliere das Modell
scene
.
add
(
zipModel
);
status
.
textContent
=
"
Modell erfolgreich geladen!
"
;
});
}
catch
(
error
)
{
console
.
error
(
'
Fehler beim Laden der ZIP-Datei:
'
,
error
);
status
.
textContent
=
"
Fehler beim Laden der ZIP-Datei.
"
;
}
// Reticle (Cursor)
const
loader
=
new
THREE
.
GLTFLoader
();
loader
.
load
(
"
https://immersive-web.github.io/webxr-samples/media/gltf/reticle/reticle.gltf
"
,
(
gltf
)
=>
{
...
...
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