You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How do i have support all the phones using TYPE_ACCELEROMETER? #22
Hi Fahim, that's a really good question. As you may know, Motion uses the Rotation Vector sensor to determine screen orientation, which it bases its parallax effect off of. The Rotation Vector sensor acts as a "virtual" sensor, combining sensor data from a phones accelerometer, geomagnetic sensor, and gyroscope to provide extremely accurate information after performing some calculations called "sensor fusion". It does this by working in quaternion coordinates, which allows the sensor to avoid issues like gimbal lock. Unfortunately, with just one of these sensors and no "sensor fusion", the library would not work very well because the orientation data would have issues. For instance, if we only used the accelerometer, the orientation could only be known relative to some reference orientation, but not absolutely. We would also run into all kinds of issues with users moving their phone, which would throw off sensor data.
Because of this, I would suggest gating your usage of Motion to only phones that have support for the Rotation Vector sensor. This will allow the majority of users who do have access to the sensor to get the full parallax effect without any hiccups, while those who don't have the sensor don't end up having a bad experience with a janky parallax effect. Right now, Motion is implemented in a way that registerSensorManager will be a no-op if the Rotation Vector sensor is not enabled, which means that you don't need to worry about actively gating the usage of Motion yourself.
@nvanbenschoten thanks for your reply... with type_accelerometer i am able to move the image from one end to other but the issue is my image keeps moving in normal state also
Activity
nvb commentedon Feb 13, 2016
Hi Fahim, that's a really good question. As you may know, Motion uses the Rotation Vector sensor to determine screen orientation, which it bases its parallax effect off of. The Rotation Vector sensor acts as a "virtual" sensor, combining sensor data from a phones accelerometer, geomagnetic sensor, and gyroscope to provide extremely accurate information after performing some calculations called "sensor fusion". It does this by working in quaternion coordinates, which allows the sensor to avoid issues like gimbal lock. Unfortunately, with just one of these sensors and no "sensor fusion", the library would not work very well because the orientation data would have issues. For instance, if we only used the accelerometer, the orientation could only be known relative to some reference orientation, but not absolutely. We would also run into all kinds of issues with users moving their phone, which would throw off sensor data.
Because of this, I would suggest gating your usage of Motion to only phones that have support for the Rotation Vector sensor. This will allow the majority of users who do have access to the sensor to get the full parallax effect without any hiccups, while those who don't have the sensor don't end up having a bad experience with a janky parallax effect. Right now, Motion is implemented in a way that
registerSensorManagerwill be a no-op if the Rotation Vector sensor is not enabled, which means that you don't need to worry about actively gating the usage of Motion yourself.fahimsakri-zz commentedon Feb 13, 2016
@nvanbenschoten thanks for your reply... with type_accelerometer i am able to move the image from one end to other but the issue is my image keeps moving in normal state also