Sign in to follow this  
KuroKage

X files AnimationKey object question

Recommended Posts

KuroKage    103
Hi, I'm using maya to export x files and have already made a parser that parses frame data and animation data. My problem is when I'm going to read the keyframes in an AnimationKey object. Basically an Animation object has n number of AnimationKey objects. The x files maya exports always has three AnimationKey objects per Animation object. These three (represented by a key type) are for rotation, scaling, and translation. So that's ok. I have a running animation where the arms just sway forwards and backwards alternately. No other bones are manipulated. So when I look up in the x file's AnimationKey object every joints other than the two arms have constant values througout their KeyFrames since they aren't altered in the animation. That much I understood. When I look up the scale AnimationKey object of the left and right arms (represented by Type 1). The values are three float numbers with 1; 1; 1; which means that there is no scaling happening in any of the three axis. When I also looked up their translation AnimationKey object, the values throughout the keyframes are constant meaning there is no translation happening in the animation. But the my problem lies in the rotation AnimationKey object. It is represented by four float numbers. I'm very new to this format. What kind of format can represent a rotation by using four float numbers? I truly apologize if the post is very long. I hope you guys can help me. Thank You.

Share this post


Link to post
Share on other sites
jamesw    400
I think rotations are represented by quaternions in that format. Sorry I can't be more helpful, I always just let D3DX take care of it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Yes they are quaternions. The components are stored in the file in this order -> w x y z. I have to negate the w component when reading in the keys in my code for them to work right.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this