Jboy
11-07-2005, 05:29 PM
This is a weird one. I need to get the Y value of the tangents of my keyframes. For example:
I convert the outtangentweight from (a percentage of the way to the next key) to (an absolute X distance) by multiplying it by the difference in time from one key to the next.
Then, trig tells me that the tangent of the angle (outtangent) = Y/X. So I can find Y by multiplying outtangent * X, with me? But looking at the curve editor, and comparing the value, it's not right. It needs to be multiplied by roughly 5.25 and then it's about right. But I hate being "about right", and the weird part is that sometimes it's a bit more, sometimes a bit less. How does max define the Y value of a key tangent internally? Anyone know?
Maybe this snippet is more clear than my explanation:
key1 = getKey $Sphere01.position.x_position.controller 1
key2 = getKey $Sphere01.position.x_position.controller 2
timedifference = key2.time - key1.time
key1OutTangentY = key1.outtangent * (key1.outtangentlength * timedifference)
key1OutTangentY *= 5.25 -- <-- Where does this come from?
I convert the outtangentweight from (a percentage of the way to the next key) to (an absolute X distance) by multiplying it by the difference in time from one key to the next.
Then, trig tells me that the tangent of the angle (outtangent) = Y/X. So I can find Y by multiplying outtangent * X, with me? But looking at the curve editor, and comparing the value, it's not right. It needs to be multiplied by roughly 5.25 and then it's about right. But I hate being "about right", and the weird part is that sometimes it's a bit more, sometimes a bit less. How does max define the Y value of a key tangent internally? Anyone know?
Maybe this snippet is more clear than my explanation:
key1 = getKey $Sphere01.position.x_position.controller 1
key2 = getKey $Sphere01.position.x_position.controller 2
timedifference = key2.time - key1.time
key1OutTangentY = key1.outtangent * (key1.outtangentlength * timedifference)
key1OutTangentY *= 5.25 -- <-- Where does this come from?
