Find set of latitudes and longitudes using user's current latitude, longitude and direction of viewing an object

ⅰ亾dé卋堺 提交于 2019-12-03 07:44:51

To obtain the viewing angle, you can use as an approximation the Camera.Parameters getHorizontalViewAngle() method. Let's call it alpha. You also know the bearing of your device from its point of view to magnetic North, let's call it beta.

From there, within a given radius, iterate through set of database locations, compute the bearing from your position to its, and check if it is inside the interval [beta-alpha/2, beta+alpha/2]

If you're not really on a rush into this, I would suggest to take a look into Mixare, its an open source framework which deals with location and AR.

you can check the code of mixare, an augmented reality browser released under the GPLv3. The repository is available at: http://github.com/mixare/mixare

There are a lot of details you have to take care of, starting from the fact that the Field of View of the camera is only programatically available since version 2.3 (IIRC) of android. You find these and lots of others in the compatibility class.

HTH, Daniele - mixare team

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!