Trajectory Calculation
In case there is no Drag Force
Velocity
V = V_{0}+at
Position
P = P_{0} + V_{0}t + \frac{1}{2}at^{2}
No Acceleration With Drag Force
Velocity
- If Drag Value == 1, it means Velocity is reduced 1/24 at every each frame at 24 fps
- Velocity at time can be calculated (1-1/24)^f (f = frame)
a\left (1-\frac{D}{fps} \right )^{F}
Position
Here, I put
for temporary.
Position will be a trajectory of . so it can be expressed by
\sum_{i=1}^{F}aDr^{i}
then that formula is
\sum_{i=1}^{F}aDr^{i} = a\frac{1-Dr^{F}}{1-Dr}
http://fnorio.com/0070two_dimentional_kinetics1/two_dimentional_kinetics1.htm#3-3
Wrangle Examples
Trajectory by Initial Velocity
vector g = {0,-9.8,0};
@P += @v*(Time) + g*pow(Time,2)/2;
@v = @v + g*Time;
Initial Vel and Drag(no force)
float step = Frame - 1;
float dragRate = 1 - TimeInc;
float dragingInTime = ( pow(dragRate,step) - 1 )/(dragRate - 1);
@P = @v *TimeInc * dragingInTime;
@v *= dragRate;
Initial Vel and Accel with Drag
vector g = {0,-9.8,0};
float step = Frame - 1;
float second = step*TimeInc;
float dragRate = 1 - TimeInc;
float dragingInTime = ( pow(dragRate,step) - 1 ) / (dragRate - 1);
vector constantPos = @v*TimeInc * dragingInTime;
vector accelPos = g*pow(TimeInc,2) * ( (step-dragingInTime) / (1-dragRate) );
@P += constantPos + accelPos;
@v = @v*pow(dragRate,step) + g*TimeInc*dragingInTime;
Target Trajectory and Time
float t1 = @trajectoryTime; //time to reach goal
vector S1 = point(@OpInput2,"P",@ptnum) - @P ;//target Position
vector g = {0,-9.8,0};
vector v0 = S1/t1 - g*t1/2;
@P += v0*Time + g*pow(Time,2)/2;
@v = v0 + g*Time;
Wikipedia