Jump to content
  • Advertisement
Sign in to follow this  
Meshboy

Bullet Trajectory

This topic is 3857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have my View Vector and my Position Vector, i need the Delta from the guns end-pipe to the gunsight, how can i implement this in the easiest way? When turning around i can´t seem to get a correct position for end-pipe using the view vector? how do you gyes solve the question of the bullet trajectory?

Share this post


Link to post
Share on other sites
Advertisement
by "end pipe" do you mean the barrel of the gun? I did this using Euler rotation.

The direction vector of the gun is rotated using Euler, then when it is fired that vector is multiplied by the speed of the projectile. The vector of translation from the barrel to the sight is also rotated by this value and used as the new origin of the sight. The sight vector is then also rotated using euler.

Personally, if I had a weapon in a game where you could look "down the sight" I would use the sight vector as the firing vector. Less trouble. The slight difference will be unnoticeable on screen.

Share this post


Link to post
Share on other sites
I just do it from the center of the screen (the cross hair)

Normalize the view vector and add it to your eye (position) vector

Basically:

dir = cam->Look;
dir.Normalize( );
dir += cam->Eye;

and then I just shoot out rays using that.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!