Time for action—managing animation channels

To achieve the same animation effect that the animation path example has already done, we have to create two channels, one with a position animation target and the other with a rotation one.

The createAnimationPath() function, which generates a circular path around the origin point, can be reused. But instead of just combining the position and rotation values into a control point structure, these two kinds of key frames should be added to separate containers that belong to different animation channels.

  1. Include the necessary headers:
    #include <osg/MatrixTransform> #include <osgAnimation/BasicAnimationManager> #include <osgAnimation/UpdateMatrixTransform> #include <osgAnimation/StackedTranslateElement> #include ...

Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.