three.js获取模型材质

const materials = object.children.map(child => child.material);
materials.forEach(material => {
    //// 检查材质是否有纹理
    //debugger
    //if (material && material.map) {
    //    // 设置材质的纹理
    //    material.map = new THREE.TextureLoader().load('path/to/your/texture.png');
    //}
    material.color.set(0xff2200);
});
posted @ 2024-07-09 14:15  暖暖De幸福  阅读(6)  评论(0编辑  收藏  举报