Added solution for R1. The object will be translated along any axis according to user presses.