I downloaded a CG object from sketchfab and trying to use it in my React app. Right now I can load the model, however texture is not applied. How do I apply it? And how do I confirm that the texture file is loaded?
const loader = new GLTFLoader();
console.log("loader", loader);
loader.load(
"/low_poly_dog/scene.gltf",
function (gltf) {
gltf.scene.scale.setScalar(8.5);
gltf.scene.position.copy(
overlay.latLngAltitudeToVector3(props.mapOptions.center)
);
scene.add(gltf.scene);
},
undefined,
function (error) {
console.error(error);
}
);