Direction in which the ship is pointing:
// Shipdegxz =Angle in X-Z direction. positive X-Axis=0°, positive Z-Axis=90°
// Shipdegxy = Angle if inclination X-Z surface to Y Axis. 0°=XZ-Plane, 90°=positive Y axis
dx = cos(Shipdegxz)
dy = sin(Shipdegxy)
dz = sin(Shipdegxz)
// make direction the total length "1"
ulen = dx*dx+dy*dy+dz*dz
dx=dx/ulen
dy=dy/ulen
dz=dz/ulen
Now it's easy:
X_CAMERA shipx,shipy,shipz, shipx+dx,shipy+dy,shipz+dz
// move
inc shipx, dx*momentum
inc shipy, dy*momentum
inc shipz, dz*momentum