MDX: KeyframedAnimationSet.GetScaleRotateTranslate

Started by
-1 comments, last by deh0512 15 years, 9 months ago
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.
David Hooks

This topic is closed to new replies.

Advertisement