- Home /
Question by
cecarlsen · Jun 25, 2012 at 07:33 PM ·
animationanimationcurvekeyframe
How does inTangent and outTangent in a KeyFrame work?
I have trouble understanding the math behind tangent values in KeyFrame structs. How do they work exactly?
The documentation is not much help: http://unity3d.com/support/documentation/ScriptReference/Keyframe-inTangent.html
Comment
Best Answer
Answer by cecarlsen · Jun 26, 2012 at 08:36 AM
Aha! http://clem.mscd.edu/~talmanl/HTML/TangentCurve.html
Given that 'key' is the type of KeyFrame:
key.outTanget represents the direction from ( key.time, key.value ) towards ( key.time+1, key.outTangent )
key.inTanget represents the direction from ( key.time, key.value ) towards ( key.time-1, -key.inTangent )