I'm having difficulty with something that should be fairly simple. I have a single geometry through the json loader. I want to duplicate this geometry and apply a modified version of the material to each. I've tried traversing through the grouped obects. Both need to share the materials from the json file. The only difference will be the value of the materials[9].map and the materials[9].emmissiveMap. Any help or guidance would be extremely apprecieated.
loader.load('chris/7.json', function(geometry, materials) {
for (var k in materials) {
materials[9].map = ballerina;
materials[9].emissiveMap = ballerina;
}
mesh = new THREE.Mesh(geometry, materials);
mesh.scale.x = mesh.scale.y = mesh.scale.z = 282.75;
mesh.translation = geometry.center();
mesh.rotateZ(90);
mesh.geometry.uvsNeedUpdate = true;
mesh.material.needsUpdate = true;
iphone2 = new THREE.Mesh(geometry, materials);
iphone2.scale.x = iphone2.scale.y = iphone2.scale.z = 282.75;
iphone2.translation = geometry.center();
iphone2.rotateZ(-24.7);
iphone2.position.z = -120;
iphone2.position.x = -120;
iphone2.geometry.uvsNeedUpdate = true;
iphone2.material.needsUpdate = true;
group.add( iphone2 );
group.add( mesh );
scene.add( group );
});