Saturday, 15 August 2015

c++ - OSG: Camera flight with AnimationPathManipulator -


html>

I'm trying to implement an OGGO :: Animation Path for a osgViewer :: viewer instance camera . : AnimationPathManipulator. My problem is that AnimationPathManipulator only changes the rotation and no change in the position for the camera applies. So it only revolves, but does not translate.

I am using OpenSynigraph Library 3.0.1.

For better information, this is my current code:

  zero cameraFlatest :: Animator (OSS Weaver :: Viewer * Viewer) {osg :: AnimationPath * Path = New OGS :: Animation Path (); Path & gt; SetLoopMode (OSG :: AnimationPath :: Zero); Osg :: AnimationPath :: ControlPoint CP1; Cp1.setPosition (OSG :: Vec3d (-200, -450,60)); Cp1.setRotation (OGS :: Quat (M_PI_2, OGOG :: VAC3 (1,0,0)); Osg :: AnimationPath :: ControlPoint CP2; Cp2.setPosition (OSG :: Vec3d (2000, -500.60)); Cp2.setRotation (OGS :: Quat (M_PI_4, osg :: Vec3 (1,0,0)); Path & gt; Insert (1.0f, cp1); Path & gt; Insert (3.0f, CP2); OsgGA :: AnimationPath Manipulator * APM = New OSGGA :: AnimationPathManPulator (Path); Viewer- & gt; SetCameraManipulator (APM); } The problem was that another active camera manipulator also updated the status of the camera. Have done OSGGA :: AnimationPathamaniPilator This works only.   

No comments:

Post a Comment