Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Use of Linear Interpolation in Unity

    • 0
    • 5
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 474
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: