Search Unity

Creating different interpolation methods

Discussion in 'Scripting' started by manuelflara, Nov 19, 2007.

  1. manuelflara

    manuelflara

    Joined:
    Jan 21, 2007
    Posts:
    87
    Some time ago I discovered the Fuse Kit for Flash, which gives a lot of power to Flash developers specially to richly animate (with code) objects of the scene. I would really like to see something like that for Unity and be able to chain movements in a very straightforward manner.

    But for starters I'd be more than happy with a bunch of functions to interpolate values (vectors and scalars) using different easing methods as the kit has:

    http://www.mosessupposes.com/Fuse/fuse2docs/com/mosesSupposes/fuse/PennerEasing.html

    The easy ones are, well, very easy: linear interpolation, sin, cos, etc. But there are some complex ones there that I would really like to have. I think those interpolation methods could give a lot of polish to stuff like camera movement little object movement here and there that looks better than sharp movement.

    So if anyone has some code or a URL of a place that would be useful to code something like that, I'd be very grateful.

    Thanks,
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    There's a bunch of them here:

    http://www.unifycommunity.com/wiki/index.php?title=Mathfx

    Also provides a good model for how you can make your own. If you want to use these on the other class you can also do something like this:

    Vector3.Lerp(pos1, pos2, Mathfx.Berp(0.0,1.0,yourLerpValue) );