hi all! How can I apply all of my model’s textures to the appropriate parts of my GLB model? So I have a stork loaded in GLB format & would like to apply the correct textures to the correct parts of the model.
Here is the code I have :
var loader = [ ];
loader [ 0 ] = new THREE.GLTFLoader ( );
var scene = new THREE.Scene ( );
LoadModel = function ( scene, loader, fileLocation ) {
textureLoader = new THREE.TextureLoader ( );
texture = textureLoader.load ( 'assets/models/glb/green.png' );
texture.flipY = false;
modelobj = loader.load ( fileLocation, function ( gltf ) {
model = gltf.scene;
console.log ( model );
texture.flipY = false; // for glTF models only
model.children [ 0 ].material.map = texture;
scene.add ( model );
} );
return ( modelobj );
}
LoadModel (
scene, loader [ 0 ], 'assets/models/glb/stork.glb'
);
Any help is GREATLY appreciated!
Thank You! <3