If you're looking for a solution to animate objects in your web project, you may want to consider using the tween.js library available at https://github.com/sole/tween.js. This library is specifically designed for animation purposes.
For a simple demonstration, you can check out this example at http://jsfiddle.net/qASPe where a square moves towards a sphere after 5 seconds. The code snippet used in this example is:
new TWEEN.Tween(ship.position)
.to(planet.position, 700) // specify destination and duration
.start();
For more complex animations, you might consider utilizing a THREE.Curve or other path mechanisms. For instance, you can refer to this demo at http://jsfiddle.net/aevdJ/12 for creating a flying path.
// Define a path
var path = new THREE.SplineCurve3([
ship.position,
// Define additional points representing the trajectory
planet.position
]);
new TWEEN.Tween({ distance: 0 })
.to({ distance: 1 }, 3000) // specify destination and duration
.onUpdate(function() {
var pathPosition = path.getPointAt(this.distance);
ship.position.set(pathPosition.x, pathPosition.y, pathPosition.z);
})
.start();
Remember to include the following line in your update function:
TWEEN.update();