iPhone 4 陀螺仪/GPS 与加速计/GPS/指南针
我即将在游戏中使用 iPhone 4 的陀螺仪/GPS 来检测旋转和平移。据我所知,陀螺仪可用于检测所有 3 个轴的旋转。
但旋转(至少在水平面上)可以用指南针检测,倾斜可以用加速度计检测,位置可以用 GPS 检测。
指南针/加速度计/GPS 的组合能否产生与陀螺仪/GPS 相同水平的检测? (我正在考虑允许没有 iPhone 4 的人使用这种组合)。
这会完美吗?
I am about to use iPhone 4's gyroscope/GPS on a game, to detect rotation and translation. As far as I know, the gyroscope can be used to detect rotations in all 3 axis.
But rotations, at least on the horizontal plane can be detected with the compass, tilts can be detected with the accelerometer and positions with the GPS.
Can a combination of compass/accelerometer/GPS create the same level of detection of gyroscope/GPS? (I am thinking of allowing this combination for people without iPhone 4).
Will this work perfectly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
陀螺仪和加速度传感器的精度远高于指南针和 GPS 的精度。指南针和 GPS 用于找出设备在地球上的位置,陀螺仪和加速计则有助于找出设备在过去几毫秒内移动过的位置。
因此,这取决于您试图通过设备的移动来控制什么。尝试模拟陀螺仪输入来控制 3D 模拟(如乔布斯在介绍 iPhone 4 的主题演讲中展示的 Jenga 游戏)仅使用指南针/加速计/GPS 无法完美工作。在增强现实游戏中确定设备是否指向街道西侧的杂货店而不是街道东侧的家具店,只需使用指南针/加速计/GPS 即可完美工作。
The precision of the gyroscope and accelerometer sensors is much greater than the precision of the compass and GPS. The compass and GPS are for finding out where the device is on the globe, and the gyroscope and accelerometer are good for finding out where the device has moved in the last few milliseconds.
Therefore it depends upon what you're trying to control with the device's movement. Trying to simulate a gyroscope input to control a 3D simulation (like the Jenga game Jobs showed in the keynote that introduced the iPhone 4) will not work perfectly with just the compass/accelerometer/GPS. Figuring out if the device is pointed at the grocery store on the west side of the street instead of the furniture store on the east side of the street in an augmented reality game will work perfectly with just the compass/accelerometer/GPS.