There are lots of ways to do curves, but for that particular one you could use a Bézier curve or an arc.
Generally for most curves you can get a formula to get any position along it by t. But the speed will vary as you move along it, so the solution to that is to convert the curve to a polyline so you can move along it at a constant speed.
Anyways here’s the simplest formula to move on a curve. A and C are the end points and B is a control point, and t changes from 0 to 1.
X=qarp(ax,bx,cx,t)
Y=qarp(ay,by,cy,t)
Again if you want to move at a constant speed along the curve you’ll need to use the formula above to get a list of points along the curve then move between them in straight lines. Another way is called arc reparameterization which avoids the polyline but requires more math to get an integral we can evaluate numerically.
A second idea in that specific curve is to just use the arc on a circle. You can derive the center and radius from three points on the circle and using this formula for the tree points. Then solve using algebra.
(X-centerX)^2+(y-centerY)^2=radius^2
Then you can get a point on the circle with
X=radius*cos(a)+centerX
Y=radius*sin(a)+centerY
So to move along an arc you lerp between the angles from the center to the endpoints. That will be constant speed.
I don’t have time to make an example but I’ve done something similar a lot so a forum search of my posts will give a fair amount of results.
If that plug-in works for you I’d go for it as well. I have not tried it.
R0J0hound
thank you for your reply,
I've tried to implement your beautiful method titled "catmullrom" cause arrow movement is so smooth and flexible, but unfortunately, I couldn't succeed.
Also, there is an old example made by you a long time ago titled "rocketfollowpath" where you use bullet behavior as a main movement trigger.
the problem with that is the movement behavior is not smooth compared to "catmullrom" movements, especially between two dashes and when it doing a curve.
is there any way you can do a C3 example for me where you use your beautiful math skills to give the red ball that smooth movement?
I am one of your main supporters through ( buy me a coffee ), and I can pay you for this example as well.
my email is:
crockware1970agw@gmail.com