Angle of North (As per Camera)

MikieK

Member
Licensed User
:sign0085:
Im sure there are a lot of you who have attempted to implement an augmented reality app. Has anyone succeeded in determining the angle of north in relation to the screen/camera? I've played around with vectors and matrices as per examples I have seen on the web, in addition to trying to bodge it- with no joy :BangHead:. SensorManager (a la java) seems to have a few functions that look useful, as in:

SensorManager.TYPE_ROTATION_VECTOR
SensorManager.getRotationMatrix
SensorManager.getOrientation
SensorManager.remapCoordinateSystem

has anyone had any success in this area? Any code or examples would be very helpful.

Also I cant help but think PhoneSensors.TYPE would be a useful property to add to the phone library as it would elliminate the need for multiple variables. (sorry wrong place, I know)
 

MikieK

Member
Licensed User
Heres my solution, it includes filters, but the values seem to be a bit erratic. The first value returns seems to translate to magnetic north (regardless of pitch and roll) I havent checked it, because I'm going to use this for a game, so I'm not concerned with the true value. You will need the attached library for thie example to work. Any other (less eratic) solutions would be greatly appreciated.
(excuse the name of the library, its really not that advanced)
 

Attachments

Top