Not sure how those two things are entirely related. If this is a serious inquiry I don't think you are going to learn here.
Probably want a heavy education in software development and engineering with a specialization in motion control. There is a lot of higher level math involved in converting physical interactions and interfacing with software to produce a result in a simulated 3d environment. A background in game development wouldn't hurt either.
Or do a lot of reading about the current VR environments actively being developed, learn their product stack and maybe reverse engineer some other AR devices to see how they work.