Looking to develop a versatile advanced viewer in three.js that can generate Gltf files. How can I gather detailed information about each component of the model?
I've explored the loader class with loader.load() from THREE.GLTFLOADER, and discovered the information (in scene.children which represent the models' components) but struggling to make it generic.
Are there any libraries or functions available that would provide access to individual components? Something similar to .getElementById, perhaps .GetAllComponents or .GetMaterialsTextures (where I can retrieve paths for textures and model components).
I'm not asking for a direct answer as I want to learn on my own.
var dracoLoader = new THREE.DRACOLoader();
dracoLoader.setDecoderPath( 'js/draco_decoder.js' );
let loader = new THREE.GLTFLoader(); // I've seen this used in tutorials, but how does it work - does it help with data compression or just encoding?
loader.setDRACOLoader( dracoLoader );
loader.load('assets/BM1294_EOS_TABLE_220X280_OUVERT/BM1294.gltf',
function(gltf){
console.log(gltf);
let mesh = gltf.scene.children[0]; // referring to one of the models
renderer.gammaOutput = true;
renderer.gammaFactor = 2.2;
scene.add(mesh);
});
Appreciate any assistance provided :)