[osg-users] extracting camera path from model
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.0011920929 0.99761581421 1.0023841858 ... 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@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] extracting camera path from model
Hi Richard, You find the node with animation path callback on and then you use dynamic_cast: osg::AnimationPathCallback* apc = dynamic_castosg::AnimationPathCallback*(node-getUpdateCallback()); Robert. On Thu, Sep 25, 2008 at 8:38 AM, Richard Baron Penman [EMAIL PROTECTED] 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.0011920929 0.99761581421 1.0023841858 ... 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@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] extracting camera path from model
oh now I see it - thanks very much! Hi Richard, You find the node with animation path callback on and then you use dynamic_cast: osg::AnimationPathCallback* apc = dynamic_castosg::AnimationPathCallback*(node-getUpdateCallback()); Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org