SDK animation export problem (rotation).

SDK animation export problem (rotation).

Anonymous
Not applicable
561 Views
5 Replies
Message 1 of 6

SDK animation export problem (rotation).

Anonymous
Not applicable

Hi, I'm trying to export rotation keyframes of an object and I have a little problem. 

Everything works fine if the rotation degree is less than 270. If the rotation degree is more than 270 -my object strangely "flips"  and then finishes his rotation.

Here's the sample rotation data from my export:

 

The object is rotating from 0 (frame 0) to 360 (frame 100) degrees.

 

The problem appears in +/- 64 frame.

Frame: 0: [1.000000,-0.000000,0.000000,-0.000000]
Frame: 4: [0.999892,-0.000000,0.014677,-0.000000]
Frame: 8: [0.998370,-0.000000,0.057071,-0.000000]
Frame: 12: [0.992215,-0.000000,0.124535,-0.000000]
Frame: 16: [0.976861,-0.000000,0.213873,-0.000000]
Frame: 20: [0.947098,-0.000000,0.320944,-0.000000]
Frame: 24: [0.897817,-0.000000,0.440368,-0.000000]
Frame: 28: [0.824785,-0.000000,0.565446,-0.000000]
Frame: 32: [0.725380,-0.000000,0.688349,-0.000000]
Frame: 36: [0.599194,-0.000000,0.800604,-0.000000]
Frame: 40: [0.448383,-0.000000,0.893841,-0.000000]
Frame: 44: [0.277687,-0.000000,0.960671,-0.000000]
Frame: 48: [0.094058,-0.000000,0.995567,-0.000000]
Frame: 52: [-0.094058,-0.000000,0.995567,-0.000000]
Frame: 56: [-0.277688,-0.000000,0.960671,-0.000000]
Frame: 60: [-0.448383,-0.000000,0.893841,-0.000000]
Frame: 64: [0.599194,-0.000000,-0.800604,-0.000000]
Frame: 68: [0.725380,-0.000000,-0.688348,-0.000000]
Frame: 72: [0.824785,-0.000000,-0.565446,-0.000000]
Frame: 76: [0.897817,-0.000000,-0.440368,-0.000000]
Frame: 80: [0.947098,-0.000000,-0.320943,-0.000000]
Frame: 84: [0.976861,-0.000000,-0.213873,-0.000000]
Frame: 88: [0.992215,-0.000000,-0.124535,-0.000000]
Frame: 92: [0.998370,-0.000000,-0.057070,-0.000000]
Frame: 96: [0.999892,-0.000000,-0.014677,-0.000000]
Frame: 100: [1.000000,-0.000000,0.000000,-0.000000]


Can anyone have an idea how to solve the problem?

 

Regards, Larry

0 Likes
562 Views
5 Replies
Replies (5)
Message 2 of 6

istan
Advisor
Advisor
you should also explain how you get these lines.. how you "export" what exactly?
0 Likes
Message 3 of 6

Anonymous
Not applicable

Here's my code for keyframe export:

 

Matrix3 tm;
AffineParts ap;
TimeValue t;

for (t=start; t<=end; t+=delta) {
	tm = node->GetNodeTM(t) * Inverse(node->GetParentTM(t));
	decomp_affine(tm, &ap);

        Quat q = ap.q ;

(and here save quaternion values x,y,z,w)
}

 

0 Likes
Message 4 of 6

istan
Advisor
Advisor
take a look at a 3x3 matrix.. cannot store multiple rotations..
0 Likes
Message 5 of 6

Anonymous
Not applicable

Hmmm, so how to solve my problem? How to get keyframe data for more than 360 degrees rotations?

 

 

0 Likes
Message 6 of 6

istan
Advisor
Advisor
you could export the animation keys.. if you just want to export, why you don't use the igame interface? http://docs.autodesk.com/3DSMAX/16/ENU/3ds-Max-SDK-Programmer-Guide/index.html?url=cpp_ref/class_i_g...
0 Likes