Re: [osg-users] Direction vector to Rotation (Attitude) Quaternion

2009-05-23 Thread Sergey Bocharov
Hi, the above code doesn't work. After some experiments a found a solution/ I make matrix invert. Неre working code: osg::PositionAttitudeTransform* Transf;// this is transform of my object Transf-setPosition(osg::Vec3(100,200,300)); osg::Quat quad; osg::Matrix matrix; matrix.makeLookAt(

[osg-users] Direction vector to Rotation (Attitude) Quaternion

2009-05-21 Thread Sergey Bocharov
Hi, All I have direction vector , how can I convert it to rotation quat? As I know I need also Up vector, I can take Z_AXIS. So I need formula to convert direction and Up vectors into Attitude quat. Thank you! Cheers, Sergey -- Read this topic online here:

Re: [osg-users] Direction vector to Rotation (Attitude) Quaternion

2009-05-21 Thread Ümit Uzun
Hi Sergey; osg::Quat quad; osg::Matrix matrix; matrix.makeLookAt(headVector, directionVector, upVector); matrix.get(quad); Hope this helps. Regards. 2009/5/21 Sergey Bocharov osgfo...@tevs.eu Hi, All I have direction vector , how can I convert it to rotation quat? As I know

Re: [osg-users] Direction vector to Rotation (Attitude) Quaternion

2009-05-21 Thread Robert Osfield
On Thu, May 21, 2009 at 10:42 AM, Ümit Uzun umituzu...@gmail.com wrote: Hi Sergey;     osg::Quat quad;     osg::Matrix matrix;     matrix.makeLookAt(headVector, directionVector, upVector);     matrix.get(quad); A small tweak to the above is required. makeLookAt takes a eye point, center

Re: [osg-users] Direction vector to Rotation (Attitude) Quaternion

2009-05-21 Thread Sergey Bocharov
Hi, Robert , Ümit So if I have object with coordinates (100,200,300) and want it to turn to point (10,20,30) I must make this : osg::PositionAttitudeTransform* Transf;// this is transform of my object Transf-setPosition(osg::Vec3(100,200,300)); osg::Quat quad; osg::Matrix