3

I am Integrating JPCT-AE with Vuforia for as Vuforia sample ImageTarget teapot model. I followed the kelmar and Sam Rad's answer and now I am able to render my model as well as teapot but in landscape mode only.

:::::BUT:::::::

When I make changes in initApplication() in ImageTarget

int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR; 
                                        or  ORIENTATION_PORTRATE;

My model starts rendering here and there on the screen which means it's not the way that teapot is rendered. As I understand, we need to change the matrix something to render model in portrait mode.

But I don't know how. If you have any idea, please refer me shortly.

4

1 回答 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.

在运行时更改 Screen.orientation 中读到,如果您切换方向,屏幕高度和宽度不会改变。它们与导致错误跟踪的默认方向保持一致。

就我个人而言,我不认为如果你改变方向,你会得到一个好的结果,但为了确保你可以向 Vuforia支持询问。团队。自行检查屏幕高度和宽度是否在方向切换期间发生变化。如果是这样,您可以创建FrameBuffer新的价值观,我相信这会解决您的问题。

于 2013-04-12T22:32:49.680 回答