|
void CtestOSGMFCView::Oneyefly()
{
// TODO: 在此添加命令处理程序代码
osg::Vec3 eye,center,up;
const osg::Vec3f hotSpotFirst(87.111,-127.753,33.948);
m_OSG->getViewer()->getCamera()->getViewMatrixAsLookAt(eye,center,up);//获取当前视点
osg::ref_ptr<osg::AnimationPath>apath=new osg::AnimationPath();
m_eyefly=new EyeFly(eye,center,hotSpotFirst,apath);//获取漫游路径,循环模式NO_LOOPING
osg::ref_ptr<osgGA::AnimationPathManipulator> apm = new osgGA::AnimationPathManipulator(apath.get());
m_OSG->getViewer()->setCameraManipulator(apm.get());//设置路径漫游器
}
菜单按钮实现取当前视点,并将当前视点为起点,直线运动到一个已知的目标点,以此为漫游路径,按下菜单按钮以后,直接漫游到了最后一个点,没有从起点开始运动到目标点的过程,这是为什么?
|
|