Skip to main content
gamedev.net
🔒 Locked

simulating arrow

Started by tinu Jul 3, 2008 at 5:49 AM 3 replies 1.4k views
Original Post
tinu
tinu
Hi, I need to simulate the motion of an arrow released from a bow at a particular height from the ground. Is it The equation of the projectile, i should use for it. I find the following equation as a result of googling. x(t) = x0 + t* v0 +t^2/2 * a0 This is a single dimension equation. What is the two diemensional equivalent of it... Expecting reply....
blueapple
blueapple
If you put t (time) on the x (horizontal) axis, and x on the y (vertical) axis then you get a "two-dimensional equation" (Or at least a two-dimensional plot).

Check out my devlog.
Mike nl
Mike nl
The equation is exactly the same for all dimensions:

p(t) = p(0) + v(0) t + a t2/2

Or, expanded for x, y and z:

px(t) = px(0) + vx(0) t + ax t2/2
py(t) = py(0) + vy(0) t + ay t2/2
pz(t) = pz(0) + vz(0) t + az t2/2

However, if the only acceleration is gravity, pointing straight down, then ax and ay wil be zero, resulting in:

px(t) = px(0) + vx(0) t
py(t) = py(0) + vy(0) t
pz(t) = pz(0) + vz(0) t + az t2/2
Million-to-one chances occur nine times out of ten!
Radan
Radan
Actually that is already a multi-dimensional equation, you just have to look at x0,v0 and a0 as vectors.

One more thing, that is not really a projectile equation, it is just an equation for particle movement with initial velocity and fixed acceleration.

if you replace a0 with -g (-9.81m/s2 on the vertical axis) you'll get your projectile equation.

EDIT: late
-----------------Always look on the bright side of Life!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.