Commit 4ad81d9f authored by Percen's avatar Percen
Browse files

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

Update public/index.html

See merge request !65
1 merge request!65Update public/index.html
Pipeline #10553 passed with stage
in 7 seconds
Showing with 5 additions and 3 deletions
+5 -3
......@@ -28,6 +28,7 @@
let models = {};
let reticle;
let currentModel;
let scene;
async function activateXR() {
const canvas = document.createElement('canvas');
......@@ -36,7 +37,7 @@
const renderer = new THREE.WebGLRenderer({ alpha: true, canvas, context: gl });
renderer.autoClear = false;
const scene = new THREE.Scene();
scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera();
camera.matrixAutoUpdate = false;
......@@ -142,7 +143,7 @@
// Funktion zum Modellwechsel
function switchModel(direction) {
// Entferne das aktuelle Modell
// Entferne das aktuelle Modell nur, wenn es bereits in der Szene ist
if (currentModel) {
scene.remove(currentModel);
}
......@@ -154,7 +155,8 @@
selectedModel = selectedModel === 'robot' ? 'flower' : 'robot';
}
currentModel = models[selectedModel].clone(); // Erstelle eine Kopie des Modells, damit es platziert werden kann
// Stelle sicher, dass das aktuelle Modell auch tatsächlich in der Szene ist
currentModel = models[selectedModel].clone(); // Erstelle eine Kopie des Modells
scene.add(currentModel);
}
......
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