hello ,
I tried to load objects with the callback method. the problem is that i have to delete the old object before adding a new one.
I tried with .dispose () but I don’t work because I use the callback method.
Some thing like this avec Three.js :
// Remove previous results
while ( container.children.length ) {
container.remove( container.children[ 0 ] );
}
my funtion :
('body').on('click', '.img-obj', function () {
const pos = (this).attr(‘id’);
var aux = assets[pos];
var format = getFormat('GLTF2', aux.formats);
if (format !== undefined) {
var uri = format.root.url;
var fileIndex = uri.lastIndexOf("/");
var path = uri.substring(0, fileIndex + 1);
var filename = uri.substring(fileIndex + 1);
callback(path,filename);
}
});
thanks for help