I have in this scene 27 meshes, each of which has an associated number. The one with the highest number will have the scale 1. The rest will have a value less than 1 successively.
Next I want it to climb each of the loops accordingly. My problem occurs when the position of each mesh is changed.
Indeed it is scaled to the size that is due, but it changes position. I'm struggling as several screens are stacking.
I just need you to climb and stay in the same position as in this example:
US states are scaled, but still keeping their position. I think that they scale to the center of the figure.
I created the meshes (each called "municipios")
for(var s=0; s< features.features[x].geometry.coordinates[0].length; s=s+1){
geometria[x].vertices.push(new THREE.Vector3((((features.features[x].geometry.coordinates[0][s][0])+75.5)*10),(((features.features[x].geometry.coordinates[0][s][1])-5.5)*10),0));
}
forma_figura[x]=new THREE.Shape(geometria[x].vertices);
extrude_geometria[x]=new THREE.ExtrudeGeometry(forma_figura[x],datos_extrusion);
municipios[x] = new THREE.Mesh( extrude_geometria[x], materialExtrude[x] );
scene.add(municipios[x]);
// so I change the scale:
//formula is the value of scale. The biggest number has escale 1.
new TWEEN.Tween(municipios[x].scale).to({ x: formula, y: formula }, 1000).start();
//this ultimate line is the same: municipios[x].scale.set(formula,formula,formula);