- Home /
Question by
ina · Dec 17, 2011 at 07:14 AM ·
mobileaccelerometer
Direction of gravity from Input.acceleration
How do you get the direction of gravity from Input.acceleration changes?
When you hold your device with screen facing up, it is obvious that the g is purely in that direction. When the device is in a skewed orientation, the gravity vector becomes split among the three coordinates. Is there a way to determine where gravity is pointing?
For example, how do you have a cube that will always point "down" in the directory of gravity?
Comment
Your answer
