Archived

This topic is now archived and is closed to further replies.

ElusDude

x file AnimationKeys

Recommended Posts

Is is possible to create an animation in 3d studio max and export this as an xfile and have it run by playing each key frame? Example: Here''s a simple cube animation in 3dmax that was exported into an x file AnimationSet { Animation { AnimationKey { 4; 2; 0;16;1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000;;, 3200;16;1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000;;; } { Scene_Root } } Animation { AnimationKey { 4; 2; 0;16;1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,11.577494,7.241573,0.000000,1.000000;;, 3200;16;1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,11.577494,7.241573,0.000000,1.000000;;; } { Box01 } } } My queston is... I''m not sure how to get the animation going. By the SDK docs, 4; // signifies a matrix key 2; // signifies 2 I believe the rest I''m kind of foggy on and it''s not too well documented. If anyone has any places they can point me to or give me some tips, I''d appreciate it.

Share this post


Link to post
Share on other sites
Yes.

"4; // signifies a matrix key" Yes
"2; // signifies 2 I believe" This is the number of keys in this key set.

The first value in each key is the Key''s Time, the second value is the number of elements that make up the key.

To animate just replace your objects matrix with the keyframe matrix at the appropriate time. To make things smooth you will need to export alot of keyframes... or interpolate between them if you only have a few.... The skinned mesh sample in DX SDK does not interpolate between the matrices ( I have no idea why. ) It does interpolate between move/scale/rotate keys though.

Share this post


Link to post
Share on other sites
I sort of understand. so the first key is equivalent to the starting position

as in... the first key being

0;16;1.0000 etc etc

and then the second key would be

3200;16;1.000 etc etc...

so, interpolate between those 2 keys to get animation? However, if you''ll notice, when the x-file exporter exports the animation, it ends up leaving those 2 key frames with similar 16 floats (which I''m guessing are rotation, scale, position, and someting else?).

Could be just a buggy x-file exporter, unless I''m missing something.

Share this post


Link to post
Share on other sites
Your right, I didn''t notice that. The keys are identical, so you wouldn''t get any animation at all. Yea, I''d say that the exporter is not working right or you have not set it to export the intermediate keys.

"(which I''m guessing are rotation, scale, position, and someting else?)."

Well, the keys you have posted are 4x4 matrices, So yes, they contain rotation, scale, and position information.

Share this post


Link to post
Share on other sites