Answer the question
In order to leave comments, you need to log in
Bezier curve and animation speed. How to build the dependence of location change on time?
In my case, any cubic Bezier curve is used, its characteristic is not important. I need to build a dependency for my move object between its location and the time aka the duration of the animation, based on the bezier curve as the speed of this change. The movement has a rectilinear trajectory of movement.
How do I need to change the X and Y coordinates of the object in each iteration of the loop like 'loop(i < duration)' so that the movement remains with a straight path (diagonal), but only the speed of movement (animation) changes?
Or how does CSS do it to make a PL analogy?
Answer the question
In order to leave comments, you need to log in
We take the library https://github.com/gre/bezier-easing and interpolate the start and end coordinates
This thing is called animation curve . Simply put, your curve is this f(t) function. Accordingly, in your case it will be V=f(t); then just use the velocity in your equation of motion. In general: x+=Vx, y+=Vy. Well, you know how to find the projection of the velocity vector on the coordinate axes from school.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question