| | |
| | | // fn(this.addObject); |
| | | const loader = new FBXLoader(); |
| | | const promise = new Promise((resolve) => { |
| | | loader.load('model/001-5.fbx', (mesh) => { |
| | | loader.load('model/04.fbx', (mesh) => { |
| | | mesh.position.set(0, 10, 0); |
| | | mesh.scale.set(5, 5, 5); |
| | | mesh.name = '1-1-1'; |
| | | // mesh.rotation.x = Utils.rotationParseNum(270); |
| | | mesh.traverse(function (child) { |
| | | if (child.isMesh) { |
| | | child.name = '1-1-1'; |
| | | |
| | | if (child.name === '不规则') { |
| | | // child.visible = false; |
| | | console.log(material); |
| | | } |
| | | if (child.name === '货架') { |
| | | child.material.color.set(0x4680BF); |
| | | } |
| | | // if (child.name === '托盘') { |
| | | // child.material.color.set(0xBEBEBE); |
| | | // } |
| | | child.castShadow = true; |
| | | child.receiveShadow = true; |
| | | } |