Advertisement Jump to content
Sign in to follow this  

MDX: KeyframedAnimationSet.GetScaleRotateTranslate

This topic is 3848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I have a keyframed animation set with rotation keys defined in a .x file as follows: AnimationKey { 0; 2; 1;4;-0.503831,0.496139,0.503831,0.496139;;, 489;4;-0.503831,0.496139,0.503831,0.496139;;; } Simple enough. My problem is that I'm trying to create a new animation set that consists of only part of this one. I use the GetScaleRotateTranslate method to extract interpolated values from frames between 1 and 489... but I get values that are incorrect. For instance, for animation k:
	startSRT = animSet.GetScaleRotateTranslate(
		1.0f / animSet.SourceTicksPerSecond, k);
	endSRT = animSet.GetScaleRotateTranslate(
		40.0f / animSet.SourceTicksPerSecond, k);

startSRT's rotation is: W -0.503831 X -0.496139 Y -0.503831 Z -0.496139 endSRT's rotation is: W -0.5038312 X -0.496139169 Y -0.5038312 Z -0.496139169 I realize this doesn't look like much of a difference (probably attributable to floating point error somewhere in the method), but the outcome is terrible. The object, which should not rotate at all, flips around like a fish out of water. Is this a characteristic of quaternion interpolation (which I was under the impression behaved perfectly)? Or is it simply a floating point problem? Is there a simple solution other than defining the new animation set in a separate file? Thanks for any input.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!