Hi Kris,

On 21/08/09 8:00 PM, Kris Dale wrote:
If osg::Matrix::makeLookAt doesn't work... it looks like I'm back to my original
question of trying to figure out what the equations are to finding the correct 
vectors
for x and z when I've already set the y vector to point at the the target 
position.

makeLookAt should still be fine but it is pretty much geared for use with a view matrix. The OpenGL camera looks down the negative Z-axis and gluLookAt and osg::Matrix::makeLookAt produce matrices for that.

Why don't you try 'makeRotate(Vec3& from, Vec3& to)'? 'from' whould be your rockets forward vector and 'to' would be the normalized ('target' - 'pos') vector.

You could combine that matrix with a translation to 'pos' or use 'getRotate' to obtain a quaternion to put into a PositionAttitudeTransform.

Should work. (Famous last words, I know ;-)
Cheers,
/ulrich
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to