1个回答

0

这是来自Vuforia示例代码的引用:

Set the screen orientation
        //
        // NOTE: It is recommended to set this because of the following reasons:
        //
        //    1.) Before Android 2.2 there is no reliable way to query the
        //        absolute screen orientation from an activity, therefore using 
        //        an undefined orientation is not recommended. Screen 
        //        orientation matching orientation sensor measurements is also
        //        not recommended as every screen orientation change triggers
        //        deinitialization / (re)initialization steps in internal QCAR 
        //        SDK components resulting in unnecessary overhead during 
        //        application run-time.
        //
        //    2.) Android camera drivers seem to always deliver landscape images
        //        thus QCAR SDK components (e.g. camera capturing) need to know 
        //        when we are in portrait mode. Before Android 2.2 there is no 
        //        standard, device-independent way to let the camera driver know 
        //        that we are in portrait mode as each device seems to require a
        //        different combination of settings to rotate camera preview 
        //        frames images to match portrait mode views. Because of this,
        //        we suggest that the activity using the QCAR SDK be locked
        //        to landscape mode if you plan to support Android 2.1 devices
        //        as well. Froyo is fine with both orientations.

我在更改屏幕方向上阅读到,如果你切换屏幕方向,屏幕高度和宽度不会发生变化。他们保持默认方向的状态,这会导致跟踪效果不佳。

个人认为,改变方向并不能得到很好的结果,但为了确保,您可以向Vuforia支持团队咨询。您可以自行检查屏幕高度和宽度是否在方向切换时发生变化。如果是,您可以使用新值创建FrameBuffer,我相信这将解决您的问题。


谢谢回复,我明白了。正如我向Vuforia主持人AlessandroB所询问的那样,他也回答说:Vuforia轴系统在横向模式下有一定的定义。并告诉我交换X和Y轴并将其设置在JPCT相机对象中。但我不明白我在哪里可以获得轴,以及我必须在哪里进行设置。如果您已经完成,请给我一些线索。这是Vuforia社区链接... https://developer.vuforia.com/forum/android/integrating-jpct-ae-vuforia - ashunkhs
@ashunkhs,抱歉我没有这样做,因为我不需要纵向模式。你为什么需要纵向模式?你的意图是什么? - Sam R.
实际上我的应用程序是竖屏模式。我无法更改其用户界面设计。因此,我需要将其更改为我的应用程序。 - ashunkhs
谢谢Sam,我明白了。感谢你的帮助。现在它也可以在竖屏模式下工作了。 - ashunkhs
@ashunkhs,很高兴听到这个消息。您可以将您的解决方案发布为自己问题的答案并接受它。这对于未来的访问者可能会有用。此外,我建议将问题标题更改为“Vuforia和jPCT在纵向模式下”或类似的更具描述性的内容。 - Sam R.

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接