Thread: [Plib-devel] Implement ssgAnimTransform?
Brought to you by:
sjbaker
From: Wolfram K. <w_...@rz...> - 2004-10-25 23:00:24
|
As you know, I am working on PPE. I now need the option to display animations of models to be converted in PPE. The viewer sample loads animation from *.ase files and displays it. I have have tweaked the ASE loader to handle a new kind of animation I need and also I have moved the code "doing" the animation into PLIB and called it from PPE. It "works" so far, see below. I have not committed it yet. I am absolutely prepared to share all code I have, but right now it is not fit to be comitted and it might just be that I have to kludge things in this insane hurry enough so that it is of no general interest. This is however just what I want to avoid. The animation data consists of different transform matrices for different times/frames. =46unctionalitywise, the bad thing about the current implementation is that the viewer code puts the animation data into the user data field. Since PPE uses this field when selecting, the animation works till the first time you select something. Also, the code is very different to the animation code we did later, for example, it does not use the animation modes etc. Does it make sense to implement and commit the following?: There would be a ssgAnimTransform which is derived from ssgTransform. It contains a array of "frame" matrices. There will be a global ssg function "ssgSetAnimTime" with the "time" as parameter that walks the tree and for each ssgAnimTransform it sets the main transform from either one of the "frame" matrices (discreet animation) or a interpolation between two (smooth animation). The app could call this function before ssgCullAndDraw(). It would be similar to the existing animation, for example with a float time like in ssgTween instead of a discreet one as in the viewer example. Also, there is the exposer demo showing off bones, but I doubt much code can be shared. All current apps would not be affected. Only if they load an ase file with animation will the ssgAnimTransform be created and these would only be active iff the app calls the ssgSetAnimTime function. Also, I could implement a global variable saying "Something animated has been loaded" so that the ssgSetAnimTime function is only called if needed.=20 This feature would be used in the viewer sample, in PPE and I can well imagine games authors using it as simple way to get animated objects into their game. Bye bye, Wolfram. |
From: Steve B. <sjb...@ai...> - 2004-10-26 00:45:16
|
Wolfram Kuss wrote: > The animation data consists of different transform matrices for > different times/frames. So create a ssgTimedSelector - put an ssgTransform node under it for each animation step - then have them all point to the same (or perhaps different) child objects. No need for a new class - let's not clutter SSG with new node types that are only needed by single applications (and not even *needed* in actual fact). ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Wolfram K. <w_...@rz...> - 2004-10-26 02:07:30
|
Steve Baker wrote: >So create a ssgTimedSelector - put an ssgTransform node under it for >each animation step - then have them all point to the same (or perhaps >different) child objects. If I uderstand correctly, ssgTimedSelector can only be used for "discreet" (non-continuous) movement? With the way I have in mind, I can interpolate between the matrices to get a fairly smooth animation. >No need for a new class - let's not clutter SSG with new node types >that are only needed by single applications (and not even *needed* >in actual fact). Well, together with the viewer it's two, but I agree that is not much. OTOH, the code to create the scene graph with the animation data will IMHO have to be in or called in the ssgLoadASE.cxx file. Bye bye, Wolfram. |
From: Steve B. <sjb...@ai...> - 2004-10-26 02:26:11
|
Wolfram Kuss wrote: > Steve Baker wrote: > > >>So create a ssgTimedSelector - put an ssgTransform node under it for >>each animation step - then have them all point to the same (or perhaps >>different) child objects. > > > If I uderstand correctly, ssgTimedSelector can only be used for > "discreet" (non-continuous) movement? > > With the way I have in mind, I can interpolate between the matrices to > get a fairly smooth animation. Oh - I'm sorry - I didn't catch that part. Just let's try to keep it as similar to the ssgTween stuff as we can so as not to multiply the number of control methodologies any more than we have to. The existing ssgTweenController class can be used to drive the amount of tween between the matrices - so all you need is a derived class from ssgTransform that allows the matrices to be tweened in the same ways as an ssgTween node does. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Wolfram K. <w_...@rz...> - 2004-10-26 02:35:11
|
Steve Baker wrote: >Just let's try to keep it as similar to the ssgTween stuff as we can so >as not to multiply the number of control methodologies any more than >we have to. Ok, I will. The current code in the viewer demo is very different in the control methology, so I will clean that up. >The existing ssgTweenController class can be used to drive the amount >of tween between the matrices - so all you need is a derived class >from ssgTransform that allows the matrices to be tweened in the same >ways as an ssgTween node does. Yes, agreed. Bye bye, Wolfram. |