Answers for "Can you help me make an algorithm out of these parameters?"
http://answers.unity.com/questions/1161098/can-you-help-me-make-an-algorithm-out-of-these-spe.html
The latest answers for the question "Can you help me make an algorithm out of these parameters?"Answer by LazyElephant
http://answers.unity.com/answers/1161129/view.html
To linearly interpolate between two 3d points, you need to calculate the vector difference between your two points. This is easy: **V** = **B**-**A**
Once you know this, you move from **A** to **B** as a percentage of the difference vector. For example, the halfway point between **A** and **B** would be : **H** = **A** + 0.5 **V**
This can be applied to scale also, since it's represented by a Vector3.
If you want to change the scale based on the distance traveled from **A** to **B**, you have to calculate what percentage of the distance has been traveled. You can do this using the *Vector3.Distance* function.
percentTraveled = Vector3.Distance( A, currentPosition ) / Vector3.Distance( A, B );
Once you know this, just linearly interpolate between the initial scale and final scale using *Vector3.Lerp*.
scale = Vector3.Lerp( initialScale, finalScale, percentTraveled );Sat, 26 Mar 2016 08:11:57 GMTLazyElephant