Original Post
I'm trying to convert a game over from DirectX to OpenGL and I'm tring to fire a cannon ball from a cannon, the ball rotates along with the cannon but the code that normally launches the cannon ball (it's projectile motion) doesn't work the same. This was the code that got the respective velocities in DirectX: weapon.Xvel = -proj.power*(cosf(proj.Xrot)*cosf(proj.Yrot)); weapon.Yvel = -proj.power*sinf(proj.Yrot); weapon.Zvel = proj.power*(sinf(proj.Xrot)*cosf(proj.Yrot)); but now when I elevate the cannon the Y direction of the object changes.( ie the whole coordinate system rotates too, if -y was pointing down and I rotate 90 deg -y is now pointing right) How can I fire the projectile in OpenGL?