So I've been spending a few hours a day trying to understand linear interpolation. My understanding of the concept has improved, as I didn't understand the math behind it previously. I decided to get graph paper so I could understand it a better, and Jamie King and bunch of other guys have some hands on demonstration about how it works which was handy.

https://www.youtube.com/watch?v=0MHkgPqc-P4The demonstration gave me a clue as to how linear interpolation works, so I decided to give it a shot. I wrote a new Vector2f method like so.

public Vector2f lerpT(Vector2f currentPos, Vector2f newPos, float alpha)

{

return currentPos.scale(1f - alpha).add(newPos.scale(alpha));

//return Vector3f point1 + alpha * (point2 - point1);

}

And my main class is like so:

public class Main {

public static void main(String[] args) throws IOException {

init();

}

public static void init() {

Vector2f currentPosition = new Vector2f(70f,68f);

Vector2f newPosition = new Vector2f(57f,80f);

Vector2f lerpPos = new Vector2f().lerpT(currentPosition, newPosition, 0.5f);

System.out.println("Testing LERP: " + "5/01/2018" + "\n");

System.out.println(lerpPos.x);

System.out.println(lerpPos.y);

This is what gets printed out into the console.

x: 63.5

y:74.0

I calculated the formula from a graph I made and with a calculator and I get the same values in the x and y's lerpPos vector that is calculated in the code. I also changed it to Vector2f to make it simpler. And instead of LWJGL I decided to make a simple console program in java.

While I understand it a bit more, I'm unsure how I'm supposed to use a velocity vector with the lerp function so I can give something some acceleration(?). I see how the alpha in the formula is important, but I'm unsure how to utilize it.

If anything, I'd like to tryout some easing in and easing out, but the witchcraft needed seems a little bit over my head just at this moment.

Any help or suggestions would be much appreciated.