I have a problem with lookAt not functioning properly since I updated to the release version of Flash11 and Away3D 4. Everything worked fine during the incubator build, and also during the Flash 11 beta build.
This is the case:
I have a mesh in an Object3d which is the player that is on a coordinate, lets say 0,0,0 that another mesh in an object3d (an opponent) should look at and follow.
The opponent object is in the same space as the player object and I have made sure that the opponent is getting the correct coordinates (0,0,0) from the player to look at.
The opponent is however looking at an completely different direction than the player is at. The opponent continues to look at that direction even if the coordinates are updated by moving the player. However, when the player is circling round the opponent, the opponent at some angle is turning to follow the player, but when the player reaches a certain angle position the opponents turns back to look at its initial distant point.
var opponentMesh:PrimitiveBase = ((opponent.skin as Away3D4Mesh).mesh as Cube).position;
opponentMesh.lookAt((player.skin.mesh as Cube).position);
What is wrong?
To me it seems to be the Object3D.lookAt function not calculating the looking objects rotation correctly.
I have not changed anything in this behavior, that worked fine before I updated to the release flash player and the newer away version.
Thanks for your help, it is really appreciated!
/Ludwig