0

我正在添加这样的对象:

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);
}

无论我尝试什么,我都无法删除这个对象。有任何想法吗?

4

1 回答 1

0

hmm ?

function removeEntity(name){
    root.remove(name);
}
于 2013-10-16T12:17:44.573 回答