首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JPCT-AE与Vuforia的集成

JPCT-AE与Vuforia的集成
EN

Stack Overflow用户
提问于 2013-04-12 16:45:12
回答 1查看 757关注 0票数 3

我正在集成JPCT-AE与Vuforia作为Vuforia样本ImageTarget茶壶模型。我遵循了凯尔玛和萨姆·拉德的answer,现在我可以渲染我的模型以及茶壶,但只能在风景模式下。

:但是:

当我在ImageTarget中对initApplication()进行更改时

代码语言:javascript
复制
int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR; 
                                        or  ORIENTATION_PORTRATE;

我的模型开始在屏幕上到处渲染,这意味着它不是茶壶的渲染方式。据我所知,我们需要改变矩阵的东西来渲染肖像模式的模型。

但我不知道该怎么做。如果你有任何想法,请尽快推荐我。

EN

回答 1

Stack Overflow用户

发布于 2013-04-13 06:32:50

这是Vuforia示例代码中的一句话:

代码语言:javascript
复制
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.

我在Changing Screen.orientation at Runtime上读到,如果你改变方向,屏幕的高度和宽度不会改变。它们保持与默认方向相同,这会导致错误的跟踪。

就我个人而言,我认为如果你改变方向,但为了确保你可以向Vuforia support提出要求,你不会得到一个好的结果。团队。自己检查一下,看看屏幕的高度和宽度在方向切换过程中是否发生了变化。如果是这样的话,你可以用新的值创建你的FrameBuffer,我相信这会解决你的问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15966848

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档