[osg-users] extracting camera path from model

Robert Osfield robert.osfield at gmail.com
Thu Sep 25 01:24:15 PDT 2008


Hi Richard,

You find the node with animation path callback on and then you use
dynamic_cast<>:

  osg::AnimationPathCallback* apc =
dynamic_cast<osg::AnimationPathCallback*>(node->getUpdateCallback());

Robert.

On Thu, Sep 25, 2008 at 8:38 AM, Richard Baron Penman
<richardbp+osg at gmail.com> wrote:
> hello,
>
> I have a model and camera animation path exported from 3ds max to osg
> format.
> In OpenSceneGraph I want to jump to any point along this animation, so I'm
> trying to extract the AnimationPath ControlPoints.
>
> Here is the relevant part of the osg file:
>
> PositionAttitudeTransform {
>     DataVariance DYNAMIC
>     name "Camera01"
>     nodeMask 0xff
>     cullingActive TRUE
>     UpdateCallbacks {
>       AnimationPathCallback {
>         DataVariance DYNAMIC
>         pivotPoint 0 0 0
>         timeOffset 0
>         timeMultiplier 1
>         AnimationPath {
>           DataVariance DYNAMIC
>           LoopMode LOOP
>           ControlPoints {
>             0 235.432098388672 9.58514785766602 0 0.500558972358704
> 0.499440401792526 0.499440401792526 0.500559031963348 1.00000011920929
> 0.999999761581421 1.00000023841858
>             ...
>
> So you can see the AnimationPath is stored within a callback within a
> Transform. My problem is I haven't figured out how to extract this path.
>
> There was a similar thread on this earlier
> (http://groups.google.com/group/osg-users/browse_thread/thread/f89d14baf366385b/1c9e025662bf2544)
> but the author was just after an initial position.
> I looked at getUpdateCallback() but the interface of its return type
> NodeCallback looks like a dead end.
> Has anyone done this before?
>
> regards,
> Richard
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>



More information about the osg-users mailing list