Question

I'm trying to build an android app that allows user to play a game by rotating around his/her phone

what I need to get it to do is for it to set an initial orientation (so they can play it in anyway they wishes to hold their phone with) and any other motion will just offset with the initial to figure out whats rotation made.

I know the Magnetic + Acceleration can give me the Rotational Matrix that maps the body frame back down to Global frame

and the Gyroscope gives me the Angular Velocity which later can be computed into another rotational matrix from how the body frame orients itself..

But how am i going to merge this two together, so they can compliment which other? What should i do?.. how should i proceed?

Was it helpful?

Solution

This problem is already solved, see getRotationMatrix in SensorManager.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top