iOS增强现实与指南针和位置

时间:2021-05-02 20:10:26

I'm trying to develop a mini "Around Me" like using camera, compass and location. I would like to display place's images on my screen. For the moment I have my location and my orientation with compass. I would like to know how can I determine the position of the place I want to display.

我正在尝试开发一个迷你“我身边”,比如使用相机,指南针和位置。我想在屏幕上显示地方的图像。目前我有我的位置和指南针的方向。我想知道如何确定我想要显示的地方的位置。

Thanks for your help ;)

谢谢你的帮助 ;)

4 个解决方案

#1


6  

Once you have relative distance and bearing, which you can determine from two points in the same coordinate space using algorithms found on this page, figuring out where a known coordinate is with respect to a known viewpoint is basically a perspective projection, the math is outlined on this Wikipedia article. The rotation of the camera is given by the compass, and the tilt by the accelerometer (the position is of course, GPS).

一旦你有相对距离和方位,你可以使用本页找到的算法从相同坐标空间中的两个点确定,找出已知坐标相对于已知视点的位置基本上是透视投影,数学概述在这篇*文章中。相机的旋转由指南针给出,而倾斜由加速度计给出(当然,位置是GPS)。

I'm trying to find a better document - there are a couple of extra things to consider - like the camera parameters etc, but this is a good starting point.

我正在努力找到一个更好的文档 - 还有一些额外的事情需要考虑 - 比如摄像头参数等,但这是一个很好的起点。

If it's too involved (like if you're not comfortable with rotation matrices) we can break it right down to the simple trig.

如果它过于复杂(如果你对旋转矩阵不熟悉),我们可以将其分解为简单的trig。

#2


1  

The code in the iPhone ARKit project does this, and quite a bit more. While you may not be able to use their complete library, it is a great reference on the subject of augmented reality.

iPhone ARKit项目中的代码可以做到这一点,而且还有更多。虽然您可能无法使用他们的完整库,但它是关于增强现实主题的一个很好的参考。

#3


0  

Check out 3DAR, it lets you add an AR view to a MKMapView app very easily. There's a video tutorial on this process, as well as some sample code, on the 3DAR site, www.3dar.us

查看3DAR,它可以让您轻松地将AR视图添加到MKMapView应用程序。在3DAR网站www.3dar.us上有关于此过程的视频教程以及一些示例代码

#4


0  

You can create a location based AR app in Junaio. It's an AR browser. Free to use and deploy in (as long as it's not a custom app and in Junaio).

您可以在Junaio中创建基于位置的AR应用程序。这是一个AR浏览器。免费使用和部署(只要它不是自定义应用程序和Junaio)。

#1


6  

Once you have relative distance and bearing, which you can determine from two points in the same coordinate space using algorithms found on this page, figuring out where a known coordinate is with respect to a known viewpoint is basically a perspective projection, the math is outlined on this Wikipedia article. The rotation of the camera is given by the compass, and the tilt by the accelerometer (the position is of course, GPS).

一旦你有相对距离和方位,你可以使用本页找到的算法从相同坐标空间中的两个点确定,找出已知坐标相对于已知视点的位置基本上是透视投影,数学概述在这篇*文章中。相机的旋转由指南针给出,而倾斜由加速度计给出(当然,位置是GPS)。

I'm trying to find a better document - there are a couple of extra things to consider - like the camera parameters etc, but this is a good starting point.

我正在努力找到一个更好的文档 - 还有一些额外的事情需要考虑 - 比如摄像头参数等,但这是一个很好的起点。

If it's too involved (like if you're not comfortable with rotation matrices) we can break it right down to the simple trig.

如果它过于复杂(如果你对旋转矩阵不熟悉),我们可以将其分解为简单的trig。

#2


1  

The code in the iPhone ARKit project does this, and quite a bit more. While you may not be able to use their complete library, it is a great reference on the subject of augmented reality.

iPhone ARKit项目中的代码可以做到这一点,而且还有更多。虽然您可能无法使用他们的完整库,但它是关于增强现实主题的一个很好的参考。

#3


0  

Check out 3DAR, it lets you add an AR view to a MKMapView app very easily. There's a video tutorial on this process, as well as some sample code, on the 3DAR site, www.3dar.us

查看3DAR,它可以让您轻松地将AR视图添加到MKMapView应用程序。在3DAR网站www.3dar.us上有关于此过程的视频教程以及一些示例代码

#4


0  

You can create a location based AR app in Junaio. It's an AR browser. Free to use and deploy in (as long as it's not a custom app and in Junaio).

您可以在Junaio中创建基于位置的AR应用程序。这是一个AR浏览器。免费使用和部署(只要它不是自定义应用程序和Junaio)。