Bullet Trajectory

Started by
1 comment, last by mightypigeon 16 years, 5 months ago
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?
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.
I just wanted to see if he would actually do it. Also, this test will rule out any problems with system services.
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.
[size="1"]

This topic is closed to new replies.

Advertisement