I've been searching high and low for the answer to my problem, but I can't seem to find a solution anywhere. I'm attempting to determine the position values that would result from an object translating Z by -100, without actually performing the calculation. My goal is to create an animation where an object flies towards the camera and stops 100 units in front of it, using Tween.js:
new TWEEN.Tween( object.position )
.to( {x: camera.position.x, y: camera.position.y, z: (camera.position.z)}, 2000 )
.easing( TWEEN.Easing.Exponential.InOut )
.start();
new TWEEN.Tween( object.rotation )
.to( {x: camera.rotation.x, y: camera.rotation.y, z: (camera.rotation.z)}, 2000 )
.easing( TWEEN.Easing.Exponential.InOut )
.start()
.onComplete(function(){
object.updateMatrix();
object.translateZ(-500);
});
Currently, the animation moves towards the camera, but then returns to its original position. I need to find a different target position than 'camera.position', one that is instead "translateZ(-500)" from it. Any suggestions on how to achieve this?