chrome mobile和safari mobile中的不同陀螺仪值 [英] Different gyroscope values in chrome mobile and safari mobile

查看:288
本文介绍了chrome mobile和safari mobile中的不同陀螺仪值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在构建一个小型全景照片查看器,可以选择使用陀螺仪导航场景。我从deviceOrientation事件中获取数据并将euler角度转换为旋转矩阵,然后将其放入一些变换中并最终使用3dMatrix变换移动css立方体。

I am currently building a small panoramic photo viewer which has an option to navigate the scene with a gyroscope. I am taking the data from the deviceOrientation event and turning the euler angles into a rotation matrix, and then putting that through some transformations and eventually moving a css cube with a 3dMatrix transform.

我的问题是我在不同设备上的不同浏览器上从deviceOrientation事件中获得了非常不同的数据,我不明白为什么。

My problem is that I am getting very different data coming in from the deviceOrientation event on different browsers on different devices, and I don't understand why.

几乎我尝试过的每一款iPhone,使用Safari移动版和Chrome浏览器,一切都很棒。值得进入并且有意义,整个体验非常无缝。

On almost every iPhone I have tried, with safari mobile and with Chrome, everything works great. The values come in and make sense, and the whole experience is quite seamless.

在三星Galaxy S3上,在Chrome中,我的数据完全不稳定。 alpha值实际上似乎并不代表围绕z轴的旋转,并且值有巨大的跳跃,例如beta跳跃从50-130度只有一个小动作。

On a Samsung Galaxy S3, in Chrome, my data is totally erratic. The alpha value doesn't actually seem to represent a rotation around the z axis, and there are huge leaps in values, like the beta leaping from 50-130 degrees with only a small motion.

在Chrome中的Galaxy Tab S 8.4中,我仍然会得到一些不稳定的值,有些来回抽搐,但我至少得到了一些近似于所需行为的东西。

On a Galaxy Tab S 8.4" in Chrome, i still get some erratic values, with some jerking back and forth, but I at least get something that approximates the desired behaviour.

在Chrome上的Nexus 7 2nd Gen上,体验是连贯的,也是有道理的。与iPhone相比,它的渲染效果不稳定,但它正在正常旋转所有内容,价值也很有意义。

On a Nexus 7 2nd gen, on Chrome, the experience is coherent and makes sense. Its rendering is choppy compared to the iPhone but it is rotating everything properly, and the values make sense.

有谁知道我怎么能够解决这些问题,或者我应该如何解决这些问题?它们可能是Android的三星端口的问题,或Android的最新版本OS。

Does anyone know how I might be able to fix these issues, or how I should address them? They may be a problem with Samsungs port of Android, or in Android itself in the newest versions of the OS.

想法?想法?建议?我现在真的迷失了。

Thoughts? Ideas? Suggestions? I am really lost at this point.

谢谢!

推荐答案

在这里你可以找到JS的细节事件:

http:// dorukeker。 com / know-thy-gyroscope-and-js-part-i /

Here you can find the details of the JS events:
http://dorukeker.com/know-thy-gyroscope-and-js-part-i/

以下是哪些设备的值不同:
< a href =http://dorukeker.com/know-thy-gyroscope-and-js-part-ii/ =nofollow> http://dorukeker.com/know-thy-gyroscope-and-js -part-ii /

Here is which values are different on which devices:
http://dorukeker.com/know-thy-gyroscope-and-js-part-ii/

这是我准备处理这些差异的JS文件:
https://github.com/dorukeker/gyronorm.js

And here is the JS file I prepared to deal with these differences:
https://github.com/dorukeker/gyronorm.js

更新:我刚刚在GitHub上更新了gyronorm.js。现在有一些函数可以告诉您设备/浏览器组合上是否有某个变量可用。检查GitHub页面下载以及如何使用。

UPDATE: I have just updated the gyronorm.js on GitHub. Now there are functions that tells you if a certain variable is available on the device/browser combination. Check the GitHub page to download and how to use.

我希望这些帮助。
享受!

I hope these help. Enjoy!

这篇关于chrome mobile和safari mobile中的不同陀螺仪值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆