简体   繁体   English

ANDROID-如何找到移动设备相对于周围世界的位置?

[英]ANDROID— How to find position of mobile relative to the world around it?

Background: 背景:

I am currently developing a Web-Based 3D multi-player motion sensor console game (Air Table Tennis). 我目前正在开发基于Web的3D多人运动传感器控制台游戏(Air Table Tennis)。 Mobile is acting as a racket for game, Sensor data (gyroscope,accelerator,rotation-vectors) is used rotate racket. 移动设备充当游戏的球拍,传感器数据(陀螺仪,加速器,旋转矢量)用于旋转球拍。 Mobile transmit sensor data to game engine(BabylonJS,NodeJS,SocketIO) where on real time I map those values. 移动设备将传感器数据传输到游戏引擎(BabylonJS,NodeJS,SocketIO),在其中我实时映射这些值。

Problem: 问题:

I want when user(holding mobile) moves in any direction my racket on game screen will also move in that particular direction. 我想要当用户(手持移动设备)朝任何方向移动时,我在游戏屏幕上的球拍也朝该特定方向移动。

For this i have studied azimuth values,velocity-graphs and Google Project Tango(Tango is using Computer Vision which in my case can not be implemented) but I am not getting anywhere. 为此,我研究了方位角值,速度图和Google Project Tango(Tango正在使用Computer Vision,在我的情况下无法实现),但我什么都没得到。 If someone suggests me anything it'll be highly appreciated! 如果有人建议我什么,将不胜感激!

You may want to look at this section here: https://developer.android.com/guide/topics/sensors/sensors_overview.html#sensors-coords 您可能需要在此处查看此部分: https : //developer.android.com/guide/topics/sensors/sensors_overview.html#sensors-coords

Just keep in mind that not all devices have gyroscopes or magnetometers, so getting phone positions relative to the earth would be impossible on such devices. 请记住,并非所有设备都具有陀螺仪或磁力计,因此在此类设备上获取手机相对于地球的位置将是不可能的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM