Yep, but the solution you gave me was using JPCT's lookAt function, and works , from that perspective my question would be:
If LookAt method is working (it does) the question is:
------------------------------------------------------------------------------------------------------------------------------------------
Basically there is a accessor method for an object's position (getPosition or getTransformedCenter) but no getAngles/getTransformedAngles...
How are object angles obtained after the rotation?-------------------------------------------------------------------------------------------------------------------------------------------
Once lookAt method has been called , how could I get the resulting angles back? How are the local angles (relative to the object's central axis) obtained now?
From your code:
public void align( Object3D object, SimpleVector position, SimpleVector target )
{
SimpleVector translation = position.calcSub( obj.getTransformedCenter() );
// Store current position and angles:
oldposition=object.getPosition();
oldangle=object.getLocalAngles();
<========== object.translate( translation );
lookAt( object, target );
position=object.getPosition();
angle=object.getLocalAngles(); <================ HOW IS THIS DONE?}
I also tried with the acos approach and atan2 approach and had the same problems that you had.
Thanks for your quick reply
.