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

后端 未结 2 551
悲&欢浪女
悲&欢浪女 2021-02-09 18:34

I am building an Android application based on Augmented Reality. The main idea is when user opens up my application, by default device\'s camera starts in preview mode. Based on

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-09 18:52

    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.

提交回复
热议问题