Question about the capabilities of the iPhone accelerometer and gyroscope and which is ideal to use for this implementation

StackOverflow https://stackoverflow.com/questions/5083272

Frage

I have a game that I am working on where I am wanting to capture the movement of the device as it stays completely flat (no tilting) but is moved forward, or backward, or side to side...Ideally, this detection would be very accurate.

I am just starting to dig into the code for how to implement the accelerometer or gyroscope, but before I get too far, I am wondering which of those technologies would be ideal to capture this type of motion?

Is that type of motion even possible to capture? It is a unique circumstance that I am implementing it, but if I could pull it off it'd be awesome.

Please let me know

War es hilfreich?

Lösung

Gyroscopes are usually used to measure rotation or orientation. In your case, I'd expect you'll be better off with the accelerometer. Now most apps I saw used the accelerometer to measure tilt but I'd be interested to see to what extent you can push your idea.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top