I have uploaded 3D model using OBJLoader and MTLLoader. I also added 2D text on marker.
now I want to remove that selected objects on click of remove button.
I also get specific object with uuid and name.
now How can i remove that object from scene ?
I tried following:
const selectedObject = this.scene.getObjectByName(name); this.scene.remove(selectedObject);
but, I got following error:
Uncaught TypeError: Cannot read property 'matrixWorld' of null at TransformControls.updateMatrixWorld (TransformControls.js:223) at Scene.updateMatrixWorld (three.module.js:8820) at WebGLRenderer.render (three.module.js:23792) at ImageAugmentationCreator.renderCanvas (imageAugmentationCreator.tsx:1344) at ImageAugmentationCreator.animate (imageAugmentationCreator.tsx:1320)
Thanks in advanced.