Hello,
I am attempting to learn how to incorporate te gyroscope for player control in a project of mine. I've encountered an issue that I cannot resolve on my own, and I'm wondering if anyone here has a solution.
For the most part it is working fine. I am using the rads/second from the gyroscope in combination with the event.deltaTime to calculate the degrees at which the phone is tilted on the x and y axis. This works well, however I've noticed that the y axis seems to be more sensitive in one direction of rotation than the other. Each time I tilt the phone on that axis, and then lay it back down on a flat surface, the angle in the y axis is incorrect. Eventually it thinks the phone is at an extreme angle.
Has anyone encountered this problem before? I'm running this on a Samsung Galaxy S2.
Attached the code in case anyone wants to take a look.
Thanks.
zip
zip
Comments
I haven't personally ran into the issue on my Droid X, but then again when I run your code and it did nothing on my Droid X. Have you tried using the Accelerometer example that comes with Gideros Studio and seeing if you have the same issue with it?
(I am assuming you mean the Accelorometer, not the gyroscope, but if I am mistaken please let me know )
Eli
I was able to implement the control sceme I wanted with the accelerometer, however I was initially trying to use the gyroscope.
As far as I can tell, I could have done what I wanted with either one (minus the weird issue I had with the gyroscope). The gyroscope seems to measure the rate of rotation of the device, while the accelerometer seems to detect the orientation of the device in relation to the ground (or towards the center of the earth following the force of gravity).
Sorry about the files. If you're still curious about what I was doing I can upload them at some point so you can see the difference.