I haven't tried it, but wouldn't changing the order of multiplication in the 
get(Inverse)Matrix methods do the trick:

return osg::Matrixd::translate(osg::Vec3d(0.0, 0.0, m_distance))*
            osg::Matrixd::translate(m_center)*
            osg::Matrixd::rotate(M_PI_2-m_elevation, 1.0, 0.0, 0.0)*
            osg::Matrixd::rotate(M_PI_2+m_heading, 0.0, 0.0, 1.0)*
            osg::Matrixd::rotate(M_PI_2, 0.0, 1.0, 0.0);    //  NEW!
            
You essentially want the "m_center" point to rotate around the object in 
addition to the camera-offset vector ("m_distance") rotating - that way you can 
still pan, but the object would stay at the same location on the screen when 
you're rotating.  So apply both translations before/after the rotations, 
instead of splitting them up.

Again, haven't tested this, just throwing the idea out.

Cheers,
Tom

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32938#32938





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to