Hi.
I’ve loaded a dice model exported to .glb format from blender.
It imports but I’d like to know how to access it after it’s loaded.
import { GLTFLoader } from './three/examples/jsm/loaders/GLTFLoader.js';
const loader2 = new GLTFLoader();
//===================================================
// This works, imports the dice but that's it
//===================================================
loader2.load('../../models/D6.glb', ( gltf ) =>{
scene.add( gltf.scene );
});
//===================================================
// This doesn't work, how do i acces what i loaded
// outside of the loading function
//===================================================
let D_6 ;
loader2.load('../../models/D6.glb',
(glb) =>{
D_6 = glb;
});
console.log("outside " + D_6);
scene.add( D_6 );
How do i manipulate the object, and how di I retrieve it after the loader is done ?
Thanks !