Skip to content

Commit

Permalink
fixed order problem
Browse files Browse the repository at this point in the history
  • Loading branch information
enkimute committed Feb 27, 2024
1 parent d05025b commit 5c08cc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/LookMaNoMatrices.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<b?-1:1);
els.forEach( el => el.sceneID = files.indexOf( el.dataset.scene ));

// Load a glTF file and upload to webGL.
Expand Down Expand Up @@ -116,3 +116,4 @@ const frame = ()=>{
requestAnimationFrame(frame);
}
frame();

0 comments on commit 5c08cc7

Please sign in to comment.