Need assistance calculating jump paths in 3d space

gummby8

New member
Joined
Sep 22, 2014
Messages
15
So I have a 3d flat terrain and I am trying to calculate how to make an entity "jump" from one location and land precisely on another.


6i4th3.png



So the entity is going to jump from left to right starting at {0, 0} and will land at {11, 5}

Gravity on this world is constant, but the entity can visit other worlds with different gravity strengths

The way the program works is, it decelerates the entity every 20th of a second so 20 "ticks" per second.

So the entity would be launched upward at a specific velocity "V" So the entities upward motion at launch would equal "V" the next tick would subtract gravity "G" from "V" so every tick looks like "V = V - G" or "V -= G"

So "G" is known. Upward force "V" should be larger or smaller depending on the distance to target. The shorter the distance the less height in the jump and vice versa. I am trying to solve for "X" and "Y" velocity to land the entity at it's target once it hits the ground again.

Hopefully that all made sense.
 
So I have a 3d flat terrain and I am trying to calculate how to make an entity "jump" from one location and land precisely on another.


6i4th3.png



So the entity is going to jump from left to right starting at {0, 0} and will land at {11, 5}

Gravity on this world is constant, but the entity can visit other worlds with different gravity strengths

The way the program works is, it decelerates the entity every 20th of a second so 20 "ticks" per second.

So the entity would be launched upward at a specific velocity "V" So the entities upward motion at launch would equal "V" the next tick would subtract gravity "G" from "V" so every tick looks like "V = V - G" or "V -= G"

So "G" is known. Upward force "V" should be larger or smaller depending on the distance to target. The shorter the distance the less height in the jump and vice versa. I am trying to solve for "X" and "Y" velocity to land the entity at it's target once it hits the ground again.

Hopefully that all made sense.
First lets simplify the problem to a 'one dimension distance' problem: That is start at (0,0) with velocity V0 and land at, say, (x1,0) with some, as yet, unknown velocity. So, starting with the constant acceleration -G (in this context G is positive) we integrate that to get the velocity v with v=V0 at time zero, and integrate v to get the distance x which is zero at time zero. Thus
v = -G t + V0
x = -0.5 G t2 + V0 t
BTW, the path of the object is (ideally) a parabola in Cartesian co-ordinates also
y(x) = a x (x-x1); \(\displaystyle 0\, \le\, x\, \le\, x_1\)
where a is some positive constant.

Anyway, choosing minimum time, the item arrives on target at time t1
t1 = \(\displaystyle \frac{V_0}{G}\, (1\, -\, \sqrt{1\, -\, \frac{2\, G\, x_1}{V_0^2}}\)
with velocity
v1 = -G t1 + V0
In this context we must have
\(\displaystyle V_0\, \ge\, \sqrt{2\, G\, x_1}\)

Now, what about the general plane z=z0 where z0 is some constant and the object starts at (x,y)=(0,0) with initial velocity V0 and ends at (x,y)=(x1,y1) with an, as yet, unknown velocity. Well rotate the (x,y) coordinate system to a (u,v) coordinate system so that the object starts at (u,v)=(0,0) with initial velocity V0 and ends at (u,v)=(u1, 0) where
u1 = \(\displaystyle \sqrt{x_1^2\, +\, y_1^2}\)
and then use the above. How can we achieve this? Solve
u1 = a x1 + b y1
0 = -b x1 + a y1
for a and b.
 
Top