1.如何获得object3d对象
通过getObjectByName('')或者通过getObjectById()获取
2.模型加载进度条
loader.load("../工厂.glb", function (gltf) {
model.add(gltf.scene);
document.getElementById("container").style.display = 'none';
}, function (xhr) {
const percent = xhr.loaded / xhr.total;
console.log('加载进度' + percent);
})
修改模型的材质
const mesh2 = mesh.clone();
mesh2.geometry = mesh.geometry.clone();
mesh2.material = mesh.material.clone();
mesh2.material.color.set(0xff0000);
 => {
if (v.isMesh) {
v.material = new THREE.MeshStandardMaterial({ color: 0xff0000 });
}
});