[Closed] Value of Bezier key in/outTangent?
Hi guys,
The help files give a pretty thorough explanation of how the value of a Bezier key .in/outTangentLength value is derived but doesn’t seem to mention anything that I can find about what the .in/outTangent value correlates to. When the value is positive the tangent “point” is above the key, when it’s negative it’s below the key and when it’s 0 the “point” is even with the key, so it looks like the value is some kind of offset relative to the key’s value but I can’t figure out the exact relationship. Like a key frame with a value of 30.00 that has an inTangent value of 1.00, I would think the inTangent value should equal 31.00… but it doesn’t. Does anybody know what the in/outTangent value is actually reflecting?
Thanks
Anyone?
What I’m trying to do is plot a bezier animation curve to a curveControl UI dialog. The curveControl wants Point2 values for the point tangents but the Bezier controller generates .in/outTangent and .in/outTangentLength values. I don’t understand how the Bezier controller calculates the .in/outTangent value to be able to plot the value as an [x,y] point in the curveControl’s “grid”. If I understood the math I could convert the Bezier values to a Point2 that the curveControl could use.
Im looking at this tomorrow for a colleague, but basically its the tangent of the keys bezier handle before and after the key. I.e going ‘in’ to the key and coming ‘out’ of it. Added a scribble from my moleskine.
cheers,
Hi Eek!
[img] http://forums.cgsociety.org/attachment.php?attachmentid=162473&stc=1 [/img]
So above, the inTangent is literally the trigonomic tangent value 0.067?
That would mean I could find the angle using the arcTangent of 0.067 which gives me 3.83309. Is that the literal angle of the tangent point relative to the key? This angle looks a lot bigger than 3.8 degrees:
[img] http://forums.cgsociety.org/attachment.php?attachmentid=162474&stc=1 [/img]
My understanding of trigonometry is terrible. Is this how Max is getting the value 0.067?
*EDIT – I think I was just zoomed in WAY too far on the Curve Editor. Anyway I zoomed out and put in an inTangent value of 1.0. The aTan of 1.0 is 45 degrees which looks about right in the Curve Editor.
Thanks for the help!!!
OK, aTan of .in/outTangent value gives the tangent angle. The .in/outTangentLength gives the length of the bottom of the “triangle” formed by the tangent (relative to the next key in the key array), which could be used as the x value of a point2 number for a graph (or the curveControl UI in this case).
For the y value:
y = the length of the side opposite from the angle’s tangent, and tangent(angle) = opposite length divided by bottom length so…
Doing the inverse of this: Tan (.in/outTangent) = y / (.in/outTangentLength) should get the length of y.
So, y = (.in/outTangentLength) * (.in/outTangent) finds the y value of the point2 number. Go math!
Does this seem right to you guys?