将jppt - ae与Vuforia集成



我将JPCT-AE与Vuforia集成为Vuforia样本ImageTarget茶壶模型。我遵循了kelmar和Sam Rad的答案,现在我能够渲染我的模型以及茶壶,但只能在景观模式下。

::::::::::::

当我在imagettarget

中更改initApplication()
int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR; 
                                        or  ORIENTATION_PORTRATE;

我的模型开始在屏幕上这里和那里渲染,这意味着它不是茶壶渲染的方式。据我所知,我们需要改变矩阵,使模型在肖像模式下呈现。

但是我不知道怎么做。如果你有任何想法,请告诉我。

这是引用自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,我相信这将解决你的问题。

最新更新