문제

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?

도움이 되었습니까?

해결책

This problem is already solved, see getRotationMatrix in SensorManager.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top