ThreeJS: Remove object from scene

前端 未结 8 1991
后悔当初
后悔当初 2021-01-30 06:45

I\'m using ThreeJS to develop a web application that displays a list of entities, each with corresponding \"View\" and \"Hide\" button; e.g. entityName View Hide

8条回答
  •  一个人的身影
    2021-01-30 07:20

    If your element is not directly on you scene go back to Parent to remove it

      function removeEntity(object) {
            var selectedObject = scene.getObjectByName(object.name);
            selectedObject.parent.remove( selectedObject );
        }
    

提交回复
热议问题