Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How can I calculate the angle of rotation/tilt of an arrow in 3D?

When I say angle I mean the angle the arrow takes when it flies through the projectile path.

I am using logic given in the below link to calculate the location in the 3D space

http://babek.info/libertybasicfiles/lbnews/nl130/proj3d.htm

and also OpenGL for rendering

share|improve this question
    
possible duplicate of Projectile Motion - Arrow –  bummzack Feb 3 '12 at 8:30
add comment

2 Answers

Take a look at this answer, remeber that in this case the 2D and 3D are quite the same thing since your arrow trajectory (probably) lies on a plane.

share|improve this answer
add comment

Simplistically the arrow will always lie tangent to the curve described by its trajectory. The tangent to any curve is simply the derivative or the slope of the curve at the point of the tangent.

To calculate this take the inverse tangent of (y1-y)/(x1-x) and repeat for the other planes to get the 3 required angles in 3D. (y1 and x1 are simply y and x values one time or distance step in advance of y and x)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.