| | |
| | | }); |
| | | } |
| | | }); |
| | | for (let k=0;k<chainList.length;k++) { |
| | | let clone = obj.clone(); |
| | | clone.position.x = 0 + chainList[k].position.x; |
| | | clone.position.y = 0 + chainList[k].position.y; |
| | | clone.position.z = 0 + chainList[k].position.z; |
| | | that.object.addObject( clone ); |
| | | chainList.map(item => { |
| | | that.object.addObject(customize(obj.clone(), item)); |
| | | }) |
| | | }); |
| | | new THREE.ObjectLoader().load( "../static/model/json/辊筒输送机.json", function (obj) { |
| | | obj.traverse (function (child) { |
| | | if (child instanceof THREE.Mesh) { |
| | | child.scale.set(1, 1, 1.8); |
| | | child.material = new THREE.MeshLambertMaterial({ |
| | | color: 0xAAAAAA |
| | | }); |
| | | } |
| | | }); |
| | | rollerList.map(item => { |
| | | that.object.addObject(customize(obj.clone(), item)); |
| | | }) |
| | | }); |
| | | new THREE.ObjectLoader().load( "../static/model/json/顶升移栽.json", function (obj) { |
| | | obj.traverse (function (child) { |
| | | if (child instanceof THREE.Mesh) { |
| | | child.scale.set(1, 1, 1.8); |
| | | child.material = new THREE.MeshLambertMaterial({ |
| | | color: 0xAAAAAA |
| | | }); |
| | | } |
| | | }); |
| | | transportList.map(item => { |
| | | that.object.addObject(customize(obj.clone(), item)); |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | function customize(clone, info) { |
| | | clone.position.x = 0 + info.position.x; |
| | | clone.position.y = 0 + info.position.y; |
| | | clone.position.z = 0 + info.position.z; |
| | | clone.rotateY(info.rotateY); |
| | | if (info.traverse !== undefined) { |
| | | let traverse = info.traverse; |
| | | clone.traverse (function (child) { |
| | | if (child instanceof THREE.Mesh) { |
| | | child.scale.set(traverse.scale.x, traverse.scale.y, traverse.scale.z); |
| | | child.material = new THREE.MeshLambertMaterial({ |
| | | color: traverse.color |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | return clone; |
| | | } |
| | | |
| | | } |
| | | |
| | | export {StoreConvey} |