I'm going to take a complete and totally unevidenced guess: date of rank since all militaries I know of have done it that way forever. If saluting goes back to the middle ages (raising the visor to acknowledge friendly intent), then other such customs may well date back to then.
Bookmarks