3DS Max Anim Key properties

Started by Niels, November 12, 2004, 15:45:40

Previous topic - Next topic

Niels

I know this is a long shot and not really LWJGL related, but I figured I'd try asking here since the MAX export code I'm doing is intended for the LWJGL community ;).

I'm having problem figuring out what the tagent_in and tangent_out properties on animation keys represents geometrically.

What I do know is that the keys are interpolated using a bezier curve. The values of two keys and their time-slot values determines the (x,y) coords of two vertices (the first and the last, V0 and V3) in a 4-knot 2D bezier curve, respectively.

I also know that tangent_in and tagent_in_length is a description of V1 and that tangent_out and tangent_out_length describes V2. I'm even fairly sure that the xx_length parameter when multiplied by the time difference between the current and the next key yields the X coords of V1 and V2.

I have determined, by trial and error, that multiplying tangent_in by 5 seems to resemble the Y-coord of V2 pretty closely (at least the motion I get is very close to what I see in MAX), but I really don't like not knowing where the number 5 came from.

Does anyone know of a detailed resource describing how MAX uses these tangent values in its interpolation between keyframes?

Niels

FWIW:

I found this on discreet's website:

Control *c = node->GetTMController()->GetPositionController();
dt = (c->GetKeyTime(PreviousIdx)-c->GetKeyTime(CurrentIdx)) / 3.0f;

since the value in IBezPoint3Key pos_key.intan.x is the tan(alpha), you can easily get the vertical location of the handle by calculating :

tan(alpha) = pos_key.intan.x = dy/dt -> dy = pos_key.intan.x * dt

dt is the horizontal coordinate of the tangent handle relative to the key value.

dy is the vertical coordinate of the tangent handle relative to the key value.


Which got me closer (with 20 frames between keys, timediff/3 wasn't far off my constant 5), but it's still a few nodges off compared to the same animation running inside MAX.[/code]