Animations again

Hi,

I know the 1.4.1 Rev. B and I am still confused about animations in COLLADA.

Question 1:

Why is the INTERPOLATION array of same size as the INPUT/OUTPUT array ?
3 points give 2 segments, so I would expect an array size of n-1.

The same for IN_TANGENT and OUT_TANGENT
IN_TANGENT starts indexing at 1, OUT_TANGENT’s index will never be n.

If I program a iteration loop I will use



n = Length(INPUT)

k = [0;stride[

for i = 0; i<n-1; ; i++
  X1 = INPUT[i];
  X2 = INPUT[i+1];
  C/T1 = OUT_TANGENT[i];
  C/T2 = IN_TANGENT[i+1];
  INTERPOLATION = INTERPOLATION[i]; //or INTERPOLATION[i+1] ?
  OUTPUT1[k] = OUTPUT[i*stride+k];
  OUTPUT2[k] = OUTPUT[(i+1)*stride+k];

Is this right for a TIME input and e.g. a vector3 output ?

Question 2:

Why is there no possibility to instanciate an within an ?

I have a lot of animations which start at time 0 and the possibilities with animations_clips are limited, so hat I cannot move such animations in time because the animation_clips start attribute is the start value for the INPUT.
So this gets an application specific problem or has to be in extended by -functionality.

So why is there no possibility for cascading animation_clips ?

For example, I have a car model and it contains animations for rotating the wheels and another two animations for acceleration and slowing down.

In a new COLLADA file I want to compound an animation of
accleration, driving, slowing down, acceleration, driving, … and so on.

Assuming that all animations start at timeoffset 0, how can I solve this ?


<animation clip start=0 end=10>
 <instance_animation url="#acc">
</animation_clip>

Problem here: What happens if animations is not defined for the time interval ? For the drive animation an additional attribute would be fine to add loopcount (including infinity). This could be included in into the end attribute as well:


maxt =  max(animationtime)
if end > max(animationtime) : t = t mod maxt

end could be -1 for infinity repeatition of the referenced animations.
Animations exceeding their time range keep their last output value constant.


<animation_clip end=10>
 <instance_animation url="extfile.dae#accel">
</animation_clip>
<animation_clip start=10 end=20>
 <instance_animation url="extfile.dae#drive">
</animation_clip>
<animation_clip start=20>
 <instance_animation url="extfile.dae#slow">
</animation_clip>

But I cannot group it (of cource I could use a naming schema for this in the name/id attributes but that’s application specific)

Assuming #slow begins not at 0s but at 10s. How can I get the same result as before, since the animation may come from a foreign source ?

So If all animations are defined at absolute times, why is there no timeoffset attribute to make them relative ?

Why is the INTERPOLATION array of same size as the INPUT/OUTPUT array ?
You always have this problem with segmented curves. Some data is per-segment and some data is per-keyframe, and the number of keyframes isn’t the same as the number of segments. You have to decide if you’re going to have arrays with different lengths, or if you’re going to have same-length arrays where some arrays contain junk data. It looks like the Collada designers went with the latter approach.
Is this right for a TIME input and e.g. a vector3 output ?
I’ve never implemented Collada’s animations myself so I’m not totally sure. It looks right, although I’m not really sure where the stride comes from. Your best bet might be to make some animations in a DCC tool that supports Collada, export the animations, and see if your program interprets them correctly.

I’m not sure about the rest of your questions. If you feel you’ve identified a flaw in Collada’s ability to properly support animations, feel free to report it on the Khronos bugzilla. The best chance of getting someone to do something about it is if you also propose a solution along with sample xml.

Steve

The stride is taken from the <accessor>.

The “Instanciation” of multiple objects is very fine in COLLADA. I can reuse definitions multiple times without copying them. But with animations this method is not very flexible.

For example I have an animation of a rotating head with a TIME-Input ranging from 0s to 10s. I have another animations Walking, a loopable (End of Animation = Start of Animation) animation which makes the movements of the legs starting at 0s ending at 2s.

These animations are stored with a model.

Now I have a different COLLADA file instanciating two versions of this model. I build an animation to move this model in world space. While moving (target: nodeid.translate) I want to use the “Walking”-animation defined in the model file. I can instanciate it in an animation_clip, but I cannot “move” the animation in time-space. So for all models there is an absolute time. Which is good if you have an absolute scene animation, but a bit inflexible with the pattern of instances.

You can add per-instance <extra> data to the <instance_animation> to transform the animations in time. Have you tried that?