|
I've been plowing through this and I can almost get what I need, I
just don't entirely understand a couple of things. Is it safe to think of the view matrix as the camera position and orientation? By doing so, I think I understand SphericalManipulator::getMatrix() method. It returns: return osg::Matrixd::translate(osg::Vec3d(0.0, 0.0, m_distance))* 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::translate(m_center); This manipulator has two parameters - heading and elevation. Heading is the angle from the x-axis in the x-y plane and elevation is the angle from the x-y plane (pi/2 would give you the z-axis). If I want the x-axis to be up rather than the z-axis, I add an additional rotation: return osg::Matrixd::translate(osg::Vec3d(0.0, 0.0, m_distance))* 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! osg::Matrixd::translate(m_center); Am I tinkering with the right stuff here? (I've also made the appropriate change to my getInverseMatrix() method.) It's feeling ok, but I do need to make more changes to the manipulators code that handles pans. Cory On 10/15/2010 5:03 PM, Cory Riddell wrote: I have been using the SphericalManipulator and it works really well for my application. |
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

