Archived

This topic is now archived and is closed to further replies.

BernardoH

Arrow Formula

Recommended Posts

I would like to make a formula for a flying arrow that goes up and down, based on the gravity and angle of shooting. X is the horizontal position and y is the vertical of the screen. Can any of you help me? I will use it for a isometric game. Thanx, Bernardo Heynemann Gehenna Project Developer Veni, Vidi, Vici (Julius Caesar)

Share this post


Link to post
Share on other sites
The horizontal velocity will remain constant. Given the verticle velocity and gravity (Lets just say it equals -10.), the arrows current velocity = it''s last velocity + gravity, and it''s new postion equals it''s last position + (horizontal velocity,vertical velocity)

Share this post


Link to post
Share on other sites
Arrow, ball... same thing. Due to the relative sizes of the objects involved in the physical simulation, we consider all these objects as particles and manipulate them as such. In other words, there's an answer to your question just a few posts down, in a thread called "Ball physics" or so.

[Edit: The thread's actually called Ball in a football game.]

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!


[edited by - Oluseyi on March 18, 2002 10:19:10 PM]

Share this post


Link to post
Share on other sites
In the absence of air resistance or any other retarding forces, then the motion of the arrow is given by the equations of projectile motion . The path of the arrow is given by:

g
y = (tan theta0)x - ------------ x2
2(v0cos theta0)2


Alternatively, if you want this expressed in terms of vertical and horizontal velicities, then

vy = v0sin theta0 - gt
vx = v0cos theta0

If you'd like to know the range of the arrow, that is given by:

v02
R = --- sin (2theta0)
g


where:
v0: initial speed of arrow
theta0: firing angle (from horizontal)
g: gravitational acceleration
t: time
x: horizontal displacement from firing point
y: vertical displacement from firing point

I hope this helps!

Timkin

[edited by - Timkin on March 18, 2002 10:42:57 PM]

Share this post


Link to post
Share on other sites
Thank u all for the help!
Sure it does help!

That´s good to see that people are still willing to help each other!

Thanx again,
Bernardo Heynemann
Gehenna Project Developer

Veni, Vidi, Vici
(Julius Caesar)

Share this post


Link to post
Share on other sites