带有指南针和位置的 iOS 增强现实 [英] iOS augmented reality with compass and location

查看:30
本文介绍了带有指南针和位置的 iOS 增强现实的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发一个迷你Around Me",例如使用相机、指南针和位置.我想在我的屏幕上显示地点的图像.目前我有我的位置和我的指南针方向.我想知道如何确定我想展示的地方的位置.

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.

感谢您的帮助;)

推荐答案

一旦你有了相对距离和方位,你可以使用 this page,确定已知坐标相对于已知视点的位置基本上是透视投影,这篇维基百科文章中概述了数学.相机的旋转由指南针给出,倾斜由加速度计给出(位置当然是GPS).

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).

我正在努力寻找更好的文档 - 需要考虑一些额外的事情 - 例如相机参数等,但这是一个很好的起点.

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.

这篇关于带有指南针和位置的 iOS 增强现实的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆