Linear interpolation simply means finding a value in between two given values, 'Lerp' is the function used for this. It will linearly interpolates
between the two given values.
Lerp can be used for following different types:-
1. Vector3 Lerp:- This will interpolate between the two given vectors.
Vector3.Lerp(Vector3 X,Vector3 Y,float Q)
Here it will interpolate between X and Y by interpolant Q.
It is mostly used in cases where you have to move an object between two given points.
2. Mathf Lerp(float):- Here it will linearly interpolates between two values
Example:-
P=20;
Q=30;
Value=Mathf.Lerp(P, Q , 0.5);
// value==25
3. Color Lerp:- It will interpolate between two colors by some value
Color Lerp(Color D, Color E, float F)
Interpolates between D and E by F
0 Comment(s)