View Full Version : Value of Bezier key in/outTangent?
Pacermike 06 June 2011, 06:14 PM 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 :)


Pacermike
06 June 2011, 03:00 AM
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.
eek
06 June 2011, 05:44 AM
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 :)
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,
Pacermike
06 June 2011, 06:41 AM
Hi Eek!
http://forums.cgsociety.org/attachment.php?attachmentid=162473&stc=1
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:
http://forums.cgsociety.org/attachment.php?attachmentid=162474&stc=1
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!!!
MatanH
06 June 2011, 07:37 AM
Edit: I need to fix my post
Pacermike
06 June 2011, 08:37 AM
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?
CGTalk Moderation
06 June 2011, 08:37 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.