THREE.js disposing gltf objects

Viewed 23

I have a THREE.js project that includes an imported gltf object:

loader.load("myObj.gltf",
function(gltf){
scene.add(gltf.scene);
},
undefined,
function(error){alert(error);});

Later, I clone the object:

let newObj = oldObj.clone();

In order to clear up memory, I have to dispose of the new cloned object, but not the original. How would I go about doing this? I tried dispose(), but that did not work.

1 Answers
Related