I am trying to move 10 meshes in different directions after some amount of time through functions lerp, lerpVectors. Both of them gave me the same result, they just teleported meshes in new positions without animation of moving there. Here is my code (with "lerp"):
var newPos;
var timer = 0;
function render() {
if (timer === 120) {
for (var i = 0; i < count; i++) {
mesh = meshes[i];
newPos = new THREE.Vector3(Math.random() * 200 - 100, Math.random() * 200 - 100, Math.random() * 200 - 100);
mesh.position.lerp(newPos, 0.5);
}
}
timer++;
renderer.render(scene, camera);
}
I am sure there is another way through calculated distances and then decreasing them to 0. But I suppose lerp and leprVectors do the same thing, so the question is what I do wrong?
r83
Maybe these both functions work not as I expect.