how to get the gltf model’s texture image out
loader.load(‘static/model/m3.glb’, function(glt) {
gltf = glt;
const parser = glt.parser;
const bufferPromises = parser.json.images.map((imageDef) => {
return parser.getDependency(‘bufferView’, imageDef.bufferView);
});
Promise.all(bufferPromises).then((buffers) => {
console.log(buffers);
// var bytes = new Uint8Array(buffers);
// var image = document.getElementById('image');
// var bytes = new Uint8Array(buffers);
// image.src = 'data:image/png;base64,'+ encode(bytes);
// console.log("====>");
// console.log(imageUrl);
});