OSG:使用AnimationPathManipulator的摄影机飞行
OSG: Camera flight with AnimationPathManipulator
我正试图通过使用osgGA::AnimationPathManipulator将osg::AnimationPath应用于我的osgViewer::Viewer实例的相机。我的问题是,AnimationPathManipulator只对摄影机应用旋转的更改,而不应用位置的更改。所以它只旋转而不平移。
我使用的是OpenSceneGraph Library 3.0.1。
为了更好地了解,这是我当前的代码:
void CameraFlyTest::animateCamera(osgViewer::Viewer* viewer) {
osg::AnimationPath* path = new osg::AnimationPath();
path->setLoopMode(osg::AnimationPath::SWING);
osg::AnimationPath::ControlPoint cp1;
cp1.setPosition(osg::Vec3d(-200,-450,60));
cp1.setRotation(osg::Quat(M_PI_2, osg::Vec3(1,0,0)));
osg::AnimationPath::ControlPoint cp2;
cp2.setPosition(osg::Vec3d(2000,-500,60));
cp2.setRotation(osg::Quat(M_PI_4, osg::Vec3(1,0,0)));
path->insert(1.0f,cp1);
path->insert(3.0f,cp2);
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(path);
viewer->setCameraManipulator(apm);
}
问题是另一个活动的摄影机操纵器也更新了摄影机的位置。osgGA::AnimationPathManipulator本身可以正常工作。
相关文章:
- opengl 飞行模拟器应用程序中的文本呈现问题
- 从实时摄影机馈送而不是图像中按形状跟踪对象
- 在将平截头体从摄影机空间转换为灯光空间以进行阴影映射方面存在主要问题
- 绕摄影机旋转opengl c++/设置旋转中心
- 如何计算摄影机对象的视图矩阵
- 当摄影机参数已知时,OpenCV图像静置
- 几何体着色器计算的线在摄影机移动时消失
- OpenCV将三维坐标投影到二维摄影机坐标
- 平行于上方向向量时,Arcball摄影机被锁定
- OpenCV在尝试从轴摄影机获取图像时出错
- 围绕世界的Y轴旋转摄影机(在O(0,0,0)处)
- 修改飞行检查 GCC 包含路径
- 在C++/OpenGL中使模型面向摄影机
- 用飞行轨迹绘制地球仪
- 从vtk渲染计算摄影机空间坐标
- 使用四元数旋转摄影机
- 在catch块中抛出一个异常会导致两个异常在飞行中吗
- 为什么使用摄影机空间而不是模型空间作为法线
- Opengl摄影机和渲染问题
- OSG:使用AnimationPathManipulator的摄影机飞行