Hi, I am trying to make a simple app when user tilt device and model in screen is rotated .. I've found some demos here in forum but I cannot make it work so i started from scratch. I have sucessfully implemented it, object is rotating but I have problem with coordinate system. I cannot find the right way how to convert between android one and jPCT one .. I am using sensor for Rotation vector and its returning quaternion describing rotation .. Then I am using built-in function to create rotation matrix from this quaternion .. and i am trying this matrix remap and use on my model.
Here is my code:
http://pastebin.com/Z7cVVXER and here is apk demo of my app:
https://www.dropbox.com/s/srcdb1j4idpyzls/app-debug.apk (large size is because of models and other stuff in app)
I tried to use only gyroscope data.. I swapped rotation angle around y and z axes and it was working fine with remap from y to z. But if i tried to compute quaternion manually by integrating as here
http://developer.android.com/guide/topics/sensors/sensors_motion.html#sensors-motion-gyro it works but if I shake device or rotate very quickly it made a huge error. Approach with rotation sensor doesnt have this kind of error, but i cant simply swap axes.
If someone of you have any idea how to make it work, I will be very happy. Thanks