Tracking movement in 3D using dead reckoning is apparently very inaccurate, with the iPhone sensors I wouldn't expect it to be accurate for more than a few seconds at best. I visited a startup working on the problem a few years ago, and they had problems even with dedicated hardware.