This Object4D demo shows how to extend the THREE.Object3D class with properties to animate it.

Click on the following to give each cube a new random target location: Random Targets

Locations are random (within a 200 unit bound). Speed is slightly random as well. Colors are random.

This demo does not use TWEEN.js. Methods and properties are in a new class called Object4D.

Add a single cube

Add 1000 cubes

Want to see something cool? Click on Random Targets repeatedly and they will eventually flock together

If you add enough cubes, the random cube locations will fill out a cube with 200x200x200 dimensions.