Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by mikaelemtinger · May 06, 2013 at 01:48 PM · animationkeyframestangents

How to interprete Keyframe.inTangent and .outTangent values

I'm need to interpolate some values between two Keyframes and I'm positive Unity is using Hermite interpolation as described here...

http://cubic.org/docs/hermite.htm

I'm guessing...

P1 = keys[ 0 ].value; P2 = keys[ 1 ].value;

...but if I set...

T1 = keys[ 0 ].outTangent; T2 = keys[ 1 ].inTangent;

...the interpolation looks OKish but doesn't reach the extremes of my curves. So I'm guessing I need to do something to the tangents before throwing them into the equation.

Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · May 06, 2013 at 02:34 PM

No, they use cubic bezier curves for each segment ;) The in and out tangent is the tangent of the desired angle and not an angle in degree or radians like the documentation suggests.

See this question for more details ;)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · May 06, 2013 at 03:15 PM 0
Share

$$anonymous$$eep in $$anonymous$$d that the equatation for a cubic bezier and a hermite spline are quite similar (like explained in the page you linked in your question). If i find the time i will post some code how to interpolate between two $$anonymous$$eyFrames

avatar image mikaelemtinger · May 06, 2013 at 03:28 PM 0
Share

That would be awesome if you could make a quick example. The only thing I'm really interested in is how to make the 1 dimensional in/outTangent into a 2D point. I've struggled all day and is going crazy ;)

avatar image
0

Answer by mikaelemtinger · May 06, 2013 at 06:46 PM

I found the solution, you need to scale the inTangent and outTangent with the delta time between the two keys. So, if you like to interpolate the value this is how (for H1 H2 H3 H4, see link in question):

 deltaTime = keys[ 1 ].time - keys[ 0 ].time;
 interpolatedValue = H1 * keys[ 0 ].value + H2 * keys[ 1 ].value + H3 * keys[ 0 ].outTangent * deltaTime + H4 * keys[ 1 ].inTangent * deltaTime;
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can the animation editor create local rotational data? 3 Answers

Blendshapes/Keyframes vs Animation Clips 0 Answers

Looping animation - Last keyframe adds extra frame 0 Answers

Adding animation clips via script 2 Answers

Cannot move keyframes from imported keyframe animation 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges