横向模式下的增强现实应用 [英] Augmented Reality App in Landscape Mode

查看:88
本文介绍了横向模式下的增强现实应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用CoreMotion框架构建增强现实应用程序.我试图退出Apple的pARk示例代码项目,但它只能在纵向模式下工作.我需要它在景观中工作.切换为横向模式时,重叠视图中的子视图会以相反的方向以错误的速率移动(它们在屏幕上移动得太快或太慢)

I am trying to build an augmented reality app using the CoreMotion framework. I have tried to go off of Apple's pARk sample code project, but it only works in portrait mode. I need it to work in landscape. When switched to landscape mode the subviews in the overlay view move in the opposite directions and at the wrong rate (they either move too fast or too slow across screen)

我已阅读其他帖子,其中提供了两种解决方案:

I have read other postings that provide two solutions:

  • 按照CoreMotion茶壶示例的建议,创建参考姿势并将该姿势的倒数应用于当前姿势.

  • Create a reference attitude and apply the inverse of that attitude to the current attitude, as suggested in the CoreMotion Tea Pot Example.

将四元数表示旋转90度

Rotate the quaternion representation of the attitude 90 degrees

我不认为第一个会起作用,因为我的增强现实应用程序要求将其引用为真北.

I do not think that the first will work because my augmented reality app requires that it be referenced to true north.

我也不理解第二次学习所需的数学.

I also do not understand the math required to do the second.

欢迎提出任何有关如何解决这一复杂问题的建议.

Any suggestions on how to accomplish this complex problem I welcome.

推荐答案

如果您真的很困惑,并且愿意使用其他工具包,请尝试 iPhone-AR-Toolkit .它既可以纵向也可以横向使用.

If you're really stuck, and are willing to use another toolkit, try iPhone-AR-Toolkit. It works in both portrait and landscape.

这篇关于横向模式下的增强现实应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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