What determines Batman's movements when gliding?
From personal experience, it will try to keep a somewhat parabolic pattern, sticking you back just a little lower than the height you originally dove from. It seems that there's a sort of timeout on this though, and if you dive for too long you won't be able to reach the same height.
With a small amount of practice, it's pretty easy to find the "sweet spot" for how far you can dive and still come to the nearly the same height you were at before.