- Home /
Get rotation vector depending on phone's forward vector
Hi,
I'm currently working on a mobile game and I'm trying to get the phone's rotation around the axis from the bottom to the top of the phone. Our game will most likely be played in Portrait mode, so I do not have to worry about the phone's orientation.
Currently I'm using the gyroscope in my phone but I have been told that far from all phones have one, and I'm wondering what the best solution would be.
Are you asking how to use gyroscope on phones that dont have a gyroscope?
I'm not even sure if I should be using the gyroscope for what I am trying to achieve. The player of our game should be able to move the player by tilting their device left and right while in portrait mode. I first thought I'd use the gyroscope for that, but maybe I need the accelerometer?
No I think you're right about using the gyroscope. Accelerometers are used for measuring g-force, gyroscopes let you measure angular change.
But how do games that require you to move your device to play the game work on cheaper phones that do not have a gyroscope then? I'm quite sure my gyroscope always shows the rotation in world space, never local space. If I point my device to the north, my Z rotation is 0, if I point it south, it is 180. I can't use either X or Y because they change depending on how much you rotate your device on the Z axis.
Your answer

Follow this Question
Related Questions
3rd player orientation using gyro with offset 0 Answers
Gyro Sensor based on Euler angles? 0 Answers
Unity 3d Phone Direction? 0 Answers
How to create a circular motion using circular equation along with rotation of object? 0 Answers
Gyroscope Gimbal Lock 0 Answers