[osg-users] AnimationPathCallback doesn't work for collada file?

2010-04-27 Thread daniele argiolas
Hi,
in my program sometimes I call an setUpdateCallback(); over a node. In this 
callback I do:


Code:

osg::AnimationPath* path = new osg::AnimationPath();
path-setLoopMode(osg::AnimationPath::NO_LOOPING);
path-insert(0.0, 
osg::AnimationPath::ControlPoint(osg::Vec3d(xpos,-ypos,0.0),osg::Quat(osg::inDegrees(-angle),osg::Z_AXIS)));
osg::NodeCallback* nc=new osg::AnimationPathCallback(path);
return nc;




If the node is an OSG model it works, otherwise if is a Collada File it doesn't 
work. It doesn't move.

Can you help me?

Thanks!
daniele

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27300#27300





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] AnimationPathCallback doesn't work for collada file?

2010-04-27 Thread daniele argiolas
And also if I convert this collada file with osgconv into a .ive o .osg remain 
the same problem.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27306#27306





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] AnimationPathCallback doesn't work for collada file?

2010-04-27 Thread daniele argiolas
Solved!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27314#27314





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] AnimationPathCallback doesn't work for collada file?

2010-04-27 Thread daniele argiolas
The problem was that applied the updatecallback directly to the node.
Now I make a MatrixTransform object and I add the node as a child.
Then I apply the updatecallback over the MatrixTransform object and now it 
works.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27319#27319





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] AnimationPathCallback doesn't work for collada file?

2010-04-27 Thread Raymond de Vries

Hi,

Thanks for sharing, although I don't understand why this is working and 
your other approach is not...


cheers
Raymond



On 4/27/2010 4:55 PM, daniele argiolas wrote:

The problem was that applied the updatecallback directly to the node.
Now I make a MatrixTransform object and I add the node as a child.
Then I apply the updatecallback over the MatrixTransform object and now it 
works.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27319#27319





___
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


[osg-users] AnimationPathCallback, how to return to the initial position

2009-09-17 Thread Francesco Argese
Hi,

I'm using AnimationPathCallback to animate an object. It works well.

Now I like to return to the initial position. How can I do it?
I have tried with reset() method but it don't give me the hoped results.

Thank you!

Cheers,
Francesco

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=17446#17446





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] AnimationPathCallback timeMultiplier

2008-09-04 Thread Robert Osfield
Hi Alan,

The sounds very much like a bug where the pause code is being broken
by changes in the multiplier.  Have a look at the
AnimationPathCallback implementation to see if you can spot what might
amiss.

Which version of the OSG are you looking at?

Robert.

On Wed, Sep 3, 2008 at 7:46 PM, Dickinson, Alan J.
[EMAIL PROTECTED] wrote:
 I have been creating an animation controller which allows the user to start,
 stop and reset the animation being visualized in OSG. I have added speed
 control keys which allow the user to speed up or slow down the simulation by
 changing the timeMultiplier value in the AnimationPathCallback class.



 When I hit the speed up key it changes the timeMultiplier by a small amount
 say 0.05 from the default 1.0 like it should.  But each time I hit the speed
 up key the position of the object being animated jumps ahead more than the
 small amount the speed up should be. When I hit the slow down key which
 subtracts 0.05 from the default 1.0, the position of the object jumps
 backwards in the path. Then continues from that point on at the slower
 speed.



 Is this the correct behavior?



 It does change the speed of the animation either faster or slower but the
 position is jumping at the transition. If I hit the slow down key enough I
 can go back to the beginning of the path.



 What am I doing wrong? Or is there a different way to control the speed of
 an animation ?



 Thanks,



 Alan Dickinson

 SAIC Intelligent Systems Applications Division

 Sr. Software Engineer

 ___
 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] AnimationPathCallback timeMultiplier

2008-09-04 Thread Ulrich Hertlein
Hi Alan and Robert,

Robert Osfield wrote:
 The sounds very much like a bug where the pause code is being broken
 by changes in the multiplier.  Have a look at the
 AnimationPathCallback implementation to see if you can spot what might
 amiss.

I believe this behaviour is due to the way the animation time is calculated.

It's not incremental (t += dt * timeMultiplier) which would be continuous when 
the
multipler changes, but absolute (t = (Tlast - Tfirst) * timeMultiplier) which 
will jump
when you change the multiplier.

Cheers,
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] AnimationPathCallback timeMultiplier

2008-09-04 Thread Dickinson, Alan J.
Hi Ulrich and Robert,
 
I agree with you Ulrich. I have been looking at the getAnimationTime
method which uses an absolute time calculation instead of a relative
delta time approach. I am working on adding a _prevTime instance
variable to the operator() method to save the _latestTime from the
previous timestamp. Then calculate the animationTime as you suggested. 
 
Not sure how the timeOffset is suppose to work. In the original absolute
formula it is subtracted from the ((Tlast-Tfirst) - timeOffset) *
timeMultiplier but that seems to be a negative offset. Is this the
correct interpretation or am I missing the intent of the timeOffset.
 
Also I am in the process of adding the ability to single step the
animation while it is paused. I think I need to change the pauseTime by
my stepSize to make this happen but I need to fix the getAnimationTime
method first. 
 
How do I force the animation to redraw while it is paused with the new
pauseTime value?
 
FYI: I have been working with both 2.4 and 2.6 released versions
currently...
 
Thanks again for your help,
 
Alan
 
Hi Alan and Robert,
 
Robert Osfield wrote:
 The sounds very much like a bug where the pause code is being broken
 by changes in the multiplier.  Have a look at the
 AnimationPathCallback implementation to see if you can spot what
might
 amiss.
 
I believe this behaviour is due to the way the animation time is
calculated.
 
It's not incremental (t += dt * timeMultiplier) which would be
continuous when the
multipler changes, but absolute (t = (Tlast - Tfirst) * timeMultiplier)
which will jump
when you change the multiplier.
 

 

 

Alan Dickinson

SAIC Intelligent Systems Applications Division

Sr. Software Engineer

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] AnimationPathCallback?

2007-09-07 Thread Paul Martz
Scratch that request. I've got it working now. I had forgotten that OSG
changes the default viewing orientation, and that if I set the view matrix
myself without a rotation, I'm effectively back in the Y-up, Z-in OpenGL
orientation.
   -Paul
 


Has anyone successfully tied an AnimationPathCallback as an update callback
to a Camera? If so, is there code available that I could take a look at?
 
Thanks,
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com http://www.skew-matrix.com/ 
303 859 9466
 

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] AnimationPathCallback?

2007-09-06 Thread Paul Martz
Has anyone successfully tied an AnimationPathCallback as an update callback
to a Camera? If so, is there code available that I could take a look at?
 
Thanks,
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com http://www.skew-matrix.com/ 
303 859 9466
 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org