Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You can use the lerp algorithm:
v0 - point A
v1 - point B
t - speed
response set as x or y
float lerp(float v0, float v1, float t) {
return v0 + t * (v1 - v0);
}
// Precise method, which guarantees v = v1 when t = 1.
float lerp(float v0, float v1, float t) {
return (1 - t) * v0 + t * v1;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question