Commit 70a73151 authored by Percen's avatar Percen
Browse files

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

Update public/index.html

See merge request !103
parents 14feb8d6 0a0b8d22
Pipeline #10629 passed with stage
in 8 seconds
Showing with 17 additions and 1 deletion
+17 -1
......@@ -189,6 +189,22 @@
console.log(`Modell ausgewählt: ${selectedModel}`);
updateMenu();
}
async function loadAndUnpackZip(zipUrl) {
const response = await fetch(zipUrl);
const buffer = await response.arrayBuffer();
const zip = await JSZip.loadAsync(buffer);
const files = {};
for (const filename of Object.keys(zip.files)) {
if (!zip.files[filename].dir) {
const content = await zip.files[filename].async('blob');
files[filename] = URL.createObjectURL(content);
}
}
return files;
}
async function activateXR() {
const canvas = document.createElement('canvas');
......@@ -211,7 +227,7 @@
status.textContent = "Lade Modell aus ZIP-Datei...";
try {
const zipUrl = './assets/models/model.zip'; // Relativer Pfad zur ZIP-Datei
const zipUrl = './assets/models/city_trash_can.zip'; // Relativer Pfad zur ZIP-Datei
const files = await loadAndUnpackZip(zipUrl);
const gltfFile = Object.keys(files).find((filename) => filename.endsWith('.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