简体   繁体   中英

Integrating JPCT-AE with Vuforia

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.

This is a quote from Vuforia sample code:

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.

I have read on Changing Screen.orientation at Runtime that screen height and width do not change if you switch the orientation. They stay the same as default orientation which results to malformed tracking.

Personally, I don't think that you get a good result if you change the orientation but in order to make sure you can ask from Vuforia support . team. Check it for yourself to see whether screen height and width change during orientation switch or not. If so, you may create your FrameBuffer with new values which I believe will solve your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM