Re: [osg-users] Rotation animation
Hi Robert, thank you again for your reply. I will try to do it with a custom callback as you suggest. Let's see if I can manage to get the behaviour I want. Best regards. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: jueves, 25 de octubre de 2012 16:42 To: OpenSceneGraph Users Subject: Re: [osg-users] Rotation animation Hi Héctor, On 25 October 2012 13:35, Héctor Martínez hector.marti...@sensetrix.com wrote: Then it seems that the only way to concatenate animations is by creating a custom UpdateCallback, right? Do you know any example about this that could help me to develop my own callback? You can nest transform nodes and attach a seperate callback to each one, but this may well not be what you are after. concatenate animations is such an open ended term that only you really know what you are after. I have also two more questions about animation: - What is the addNestedCallback function used for? The OSG doesn't use a concept of pre and post traversal callbacks for each of the different traversal but instead uses a scheme where multiple callbacks can be nested within each other. The advantage of this approach is that it makes it much easier to manage local state in a thread safe way and to control traversal. - Is it possible to have different animations attached to the same node and play only one at a time? The AnimationPathCallback doesn't support this but there is nothing to stop you from implementing your own callback to do this, or assign different paths at different times. Again I'd encourage you to roll your sleves up and code youself a custon update callback to do the animation exactly the way you need to. Robert. ___ 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] Rotation animation
Hi, I am trying to make an animation to one model. What I want is to rotate the model around its own axis and also to translate (rotation again) around another pivot point, like Earth movements. I can achieve both movements separately, but I dont know how to make both animations work at the same time. I have tried nesting animations and similar ideas, but without luck. Could somebody give me some clues to get the solution to my problem? Thank you in advance, Best regards ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rotation animation
Hi Hector, There several ways of achiving what you want, one could precompute all the positions and put them into an osg::AnimationPath and attach this via an osg::AnimationPathCallback to a transform above the subgraph you want to move - see the osganimation example, or write your own update callback that computes the position on the fly for each new frame. Perhaps I'd go for the callback approach. Robert. On 25 October 2012 08:22, Héctor Martínez hector.marti...@sensetrix.com wrote: Hi, I am trying to make an animation to one model. What I want is to rotate the model around its own axis and also to translate (rotation again) around another pivot point, like Earth movements. I can achieve both movements separately, but I don’t know how to make both animations work at the same time. I have tried nesting animations and similar ideas, but without luck. Could somebody give me some clues to get the solution to my problem? Thank you in advance, Best regards ___ 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] Rotation animation
Hi Robert, thank you for your answer. I was using osg::AnimationPath for individual animations, but when trying to combine both animations the behaviour is not the desired. The problem is that I want to change dynamically the pivot point of the translation animation. In other words, the rotation has to be always the same (centered in the model), and it has also to translate around a dynamic pivot point. If I do this separately, it works. But if I add both animations using addUpdateCallback, only the translation is working. I am a bit lost in the animationpath concept. Is it possible to add 2 animationpaths to the same PositionAttitudeTransform? Thank you. Best regards -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: jueves, 25 de octubre de 2012 13:06 To: OpenSceneGraph Users Subject: Re: [osg-users] Rotation animation Hi Hector, There several ways of achiving what you want, one could precompute all the positions and put them into an osg::AnimationPath and attach this via an osg::AnimationPathCallback to a transform above the subgraph you want to move - see the osganimation example, or write your own update callback that computes the position on the fly for each new frame. Perhaps I'd go for the callback approach. Robert. On 25 October 2012 08:22, Héctor Martínez hector.marti...@sensetrix.com wrote: Hi, I am trying to make an animation to one model. What I want is to rotate the model around its own axis and also to translate (rotation again) around another pivot point, like Earth movements. I can achieve both movements separately, but I dont know how to make both animations work at the same time. I have tried nesting animations and similar ideas, but without luck. Could somebody give me some clues to get the solution to my problem? Thank you in advance, Best regards ___ 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 mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rotation animation
Hi Héctor, On 25 October 2012 12:34, Héctor Martínez hector.marti...@sensetrix.com wrote: thank you for your answer. I was using osg::AnimationPath for individual animations, but when trying to combine both animations the behaviour is not the desired. The problem is that I want to change dynamically the pivot point of the translation animation. In other words, the rotation has to be always the same (centered in the model), and it has also to translate around a dynamic pivot point. If I do this separately, it works. But if I add both animations using addUpdateCallback, only the translation is working. I am a bit lost in the animationpath concept. Is it possible to add 2 animationpaths to the same PositionAttitudeTransform? The AnimationPathCallback doesn't support attached two AnimationPath. One could write your callback that does this but you'd need to make sure that local and transform origins are all consistent. As I said in my previous email I'd recommend using your own custom UpdateCallback. This way you can compute the path exactly for each frame as per your requirements. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rotation animation
Hi Robert, thank you again. Then it seems that the only way to concatenate animations is by creating a custom UpdateCallback, right? Do you know any example about this that could help me to develop my own callback? I have also two more questions about animation: - What is the addNestedCallback function used for? - Is it possible to have different animations attached to the same node and play only one at a time? Best regards -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: jueves, 25 de octubre de 2012 15:16 To: OpenSceneGraph Users Subject: Re: [osg-users] Rotation animation Hi Héctor, On 25 October 2012 12:34, Héctor Martínez hector.marti...@sensetrix.com wrote: thank you for your answer. I was using osg::AnimationPath for individual animations, but when trying to combine both animations the behaviour is not the desired. The problem is that I want to change dynamically the pivot point of the translation animation. In other words, the rotation has to be always the same (centered in the model), and it has also to translate around a dynamic pivot point. If I do this separately, it works. But if I add both animations using addUpdateCallback, only the translation is working. I am a bit lost in the animationpath concept. Is it possible to add 2 animationpaths to the same PositionAttitudeTransform? The AnimationPathCallback doesn't support attached two AnimationPath. One could write your callback that does this but you'd need to make sure that local and transform origins are all consistent. As I said in my previous email I'd recommend using your own custom UpdateCallback. This way you can compute the path exactly for each frame as per your requirements. Robert. ___ 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] Rotation animation
Hi Héctor, On 25 October 2012 13:35, Héctor Martínez hector.marti...@sensetrix.com wrote: Then it seems that the only way to concatenate animations is by creating a custom UpdateCallback, right? Do you know any example about this that could help me to develop my own callback? You can nest transform nodes and attach a seperate callback to each one, but this may well not be what you are after. concatenate animations is such an open ended term that only you really know what you are after. I have also two more questions about animation: - What is the addNestedCallback function used for? The OSG doesn't use a concept of pre and post traversal callbacks for each of the different traversal but instead uses a scheme where multiple callbacks can be nested within each other. The advantage of this approach is that it makes it much easier to manage local state in a thread safe way and to control traversal. - Is it possible to have different animations attached to the same node and play only one at a time? The AnimationPathCallback doesn't support this but there is nothing to stop you from implementing your own callback to do this, or assign different paths at different times. Again I'd encourage you to roll your sleves up and code youself a custon update callback to do the animation exactly the way you need to. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org