iOS augmented reality with compass and location(带有指南针和位置的 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 增强现实的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:带有指南针和位置的 iOS 增强现实
基础教程推荐
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01