PDA

View Full Version : MAXkey tangent Y * 5.25!?


Jboy
11-07-2005, 06: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?

michaelcomet
11-08-2005, 01:32 PM
It's been a long time since I've used Max. You might want to look at some of my key manager/tangent smooth stuff in my smooth script I have on my site.

If I recall I think the tangent is the slope but as an ANGLE not as y/x. So I think it is in degrees. I may be wrong tho...

CGTalk Moderation
11-08-2005, 01:32 PM
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.