我正在添加这样的对象:
root = new THREE.Object3D();
scene.add(root);
var geometry = new THREE.PlaneGeometry(300, 150, 1, 1);
var material = new THREE.MeshBasicMaterial({color: 0x676767, wireframe: false, side: THREE.DoubleSide});
rect = new THREE.Mesh(geometry, material);
rect.rotation.x = Math.PI / 2;
rect.name = "rect";
root.add(rect);
然后后来我尝试用这个删除“rect”:
function removeEntity(object){
root.remove(object.name);
}
无论我尝试什么,我都无法删除这个对象。有任何想法吗?