Create an Object3D
camTarget:Object3D = new Object3D();
Target your camera to it
cam.target=camTarget;
In you mouse event you can animate camTarget to the newly selected
object:
TweenLite.to(camTarget, 1, {x: e.object.x, y: e.object.y, z:
e.object.z});
As a side note, since performance is key in Away3D projects:
- creating a variable var cameraSpeed:Number=0.3;) in the onEnterFrame
is not a good idea. You should make it a persistent variable.
- var object:Object3D=e.object; is not necessary. e.object is an
Object3D :)
ath.
Jerome.