Commit 14feb8d6 authored by Percen's avatar Percen
Browse files

Merge branch '21pesi1bif-master-patch-93887' into 'master'

Update public/index.html

See merge request !102
parents 92e572c3 e3698fd5
Pipeline #10628 passed with stage
in 8 seconds
Showing with 27 additions and 0 deletions
+27 -0
...@@ -153,6 +153,9 @@ ...@@ -153,6 +153,9 @@
<div class="menu-item" id="lantern-item" onclick="selectModel('tree')"> <div class="menu-item" id="lantern-item" onclick="selectModel('tree')">
<img src="previewImages/tree.png" alt="Baum" style="width: 50px; height: 50px;"> <img src="previewImages/tree.png" alt="Baum" style="width: 50px; height: 50px;">
</div> </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()"> <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>
...@@ -203,6 +206,30 @@ ...@@ -203,6 +206,30 @@
light.position.set(10, 10, 10); light.position.set(10, 10, 10);
scene.add(light); 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) // Reticle (Cursor)
const loader = new THREE.GLTFLoader(); const loader = new THREE.GLTFLoader();
loader.load("https://immersive-web.github.io/webxr-samples/media/gltf/reticle/reticle.gltf", (gltf) => { loader.load("https://immersive-web.github.io/webxr-samples/media/gltf/reticle/reticle.gltf", (gltf) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment