I’m currently working on a school project and I want to shoot a projectile from a auto-aiming spherical turret with a muzzle at a target.
I already got the right formulas for the trajectory from the center of the turret to the target and it’s working fine so far. The Turret’s (and therefore the muzzle’s) rotation is set to match the initial velocity of the projectile.
But it still looks wrong, because the projectile is not released from the muzzle. Instead it comes out from under the barrel and of course it gets worse when the trajectory is higher.
What I want to do is set the muzzle as the origin of the projectile trajectory, so that the rotation of the turret/muzzle aligns with the initial velocity of the projectile. The Rotation should not be constrained in any way and the speed of the bullet should be fixed. I don’t use air resistance yet, so acceleration and deceleration can be ignored.
Sorry for the beautiful Paint image:
So how can I get the right turret rotation and therefore the muzzle position?
Has anyone encountered this problem? Can anyone help me please?