how can i get the heading of the device with CMDeviceMotion in iOS 5
I'm developing an AR app using the gyro. I have use an apple code example pARk. It use the rotation matrix to calculate the position of the coordinate and it do really well, but now I'm trying to implement a "radar" and I need to rotate this in function of the device heading. I'm using the CLLocationManager heading but it's not correct. The question is, how can I get the heading of the device using the CMAttitude to reflect exactly what I get in the screen?? I'm new with rotation matrix and that kind of things. This is part of the code used to calculate the AR coordinates. Update the