From 5c08cc7cdd0d6e9493202c12f20e57417eaf558f Mon Sep 17 00:00:00 2001 From: enki Date: Tue, 27 Feb 2024 16:51:40 +0100 Subject: [PATCH] fixed order problem --- src/LookMaNoMatrices.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/LookMaNoMatrices.js b/src/LookMaNoMatrices.js index 18d3866..73613a8 100644 --- a/src/LookMaNoMatrices.js +++ b/src/LookMaNoMatrices.js @@ -48,7 +48,7 @@ const render = new miniRender({canvas}); // Grab all html elements we need to render glTF files behind. const els = [...document.querySelectorAll(".glTF")]; -const files = els.map(x=>x.dataset.scene).filter((x,i,a)=>a.indexOf(x)==i); +const files = els.map(x=>x.dataset.scene).filter((x,i,a)=>a.indexOf(x)==i).sort((a,b)=>a el.sceneID = files.indexOf( el.dataset.scene )); // Load a glTF file and upload to webGL. @@ -116,3 +116,4 @@ const frame = ()=>{ requestAnimationFrame(frame); } frame(); +