
Angle of projectile
I am having trouble with the height component of a simple projectile equation...
Here is what I have done already:
Distance = GetDistance3D(Bullet(x).BulletStartPosition.x, 0, Bullet(x).BulletStartPosition.z, Bullet(x).BulletPosition.x, 0, Bullet(x).BulletPosition.z)
Bullet(x).BulletPosition.x = Bullet(x).BulletPosition.x + Cos(Bullet(x).BulletAngleY)
Bullet(x).BulletPosition.z = Bullet(x).BulletPosition.z + Sin(Bullet(x).BulletAngleY)
This works fine, the bullet moves at the correct angle. I am having a problem with the height of the bullet as it moves through the air. I think it should be something like this:
Bullet(x).BulletPosition.y = Tan(Bullet(x).BulletAngleX) * Distance
However, this doesn't work. I am not worried about gravity pulling the bullet down, i just want to shoot a bullet in the desired direction.
Please help
thanks