|
osg的OrbitManipulator中void OrbitManipulator::trackball( osg::Vec3d& axis, float& angle, float p1x, float p1y, float p2x, float p2y )函数中
osg::Matrixd rotation_matrix(_rotation);
osg::Vec3d uv = Vec3d(0.0f,1.0f,0.0f)*rotation_matrix;
osg::Vec3d sv = Vec3d(1.0f,0.0f,0.0f)*rotation_matrix;
osg::Vec3d lv = Vec3d(0.0f,0.0f,-1.0f)*rotation_matrix;
osg::Vec3d p1 = sv * p1x + uv * p1y - lv * tb_project_to_sphere(_trackballSize, p1x, p1y);
osg::Vec3d p2 = sv * p2x + uv * p2y - lv * tb_project_to_sphere(_trackballSize, p2x, p2y);
什么意思?
谁会谁说 |
|