----- From: John Vidar Larring at 2008-10-30 21:42-----
Hi Steven,
Here is a snipplet of code from the osgautocapture example that I just
sent to osg-submissions (if my email got through?), provided as is. I
hope it might be of help:
Hi John,
Thanks for the code. I tried it (and it also rekindled my interest in
ViewMatrixLookAt) but I still got gimbal-lock. Perhaps my
implementation of your code is faulty.
I've spent days now trying to learn enough about quaternions. This
almost works but my calculation for the rotation angle is still
wrong. Is there a function in OSG for calculating a quaternion from
euler angles ? I've searched but haven't found anything.
The standard code to calculate a quaternion uses w = cosx * cosy * cosz
+ sinx * siny * sinz. This doesn't seem right to me and it doesn't work
in my testing. I would expect the final rotation to be between the
largest input rotation and PI.
I hope this post is sufficiently on-topic for the osg-users list. I
apologise if I should be looking elsewhere.
Thanks,
Steven
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org