I have a goal to connect the right side of mesh 1 with the left side of mesh 2.
Whenever I scale mesh 1, it requires me to readjust the position of mesh 2 in order to maintain the original distance between them.
Let's try scaling mesh 1 by setting z: 2
var tween = new TWEEN.Tween(mesh1.scale).to({ z: 2 }, 1000).start();
tween.easing(TWEEN.Easing.Elastic.InOut);
To keep the same distance from mesh 1 as before, I must reposition mesh 2 to z: 1.5
var tween = new TWEEN.Tween(mesh2.position).to({ z: 1.5 }, 1000).start();
tween.easing(TWEEN.Easing.Elastic.InOut);
Is there a way to automatically adjust the position of mesh 2 when scaling mesh 1 so they stay connected?
https://i.sstatic.net/YUbNI.jpg
...
var geometry = new THREE.BoxGeometry( 1, 1, 1 );
var mesh1 = new THREE.Mesh( geometry,
new THREE.MeshPhongMaterial({color: 0x222222}));
mesh1 .position.set( 0, 0, 0 );
mesh1 .scale.set( 1, 1, 1 );
scene.add( mesh1 );
var mesh2 = new THREE.Mesh( geometry,
new THREE.MeshPhongMaterial({color: 0x222222}));
mesh2 .position.set( 0, 0, 1 );
mesh2 .scale.set( 1, 1, 1 );
scene.add( mesh2 );