Vuforia + JPCT : Portrait Mode

Started by lolo, September 26, 2013, 08:25:16 AM

Previous topic - Next topic

lolo

Hi ! Im working with vuforia and JPCT, i followed the tutorial : http://www.jpct.net/wiki/index.php/Integrating_JPCT-AE_with_Vuforia

But i can set my app to work correctly in portrait mode. I read a lot of threads talking about this but i didnt found the solution.
Anybody has THE ANSWER?


Thanks

EgonOlsen

Disclaimer: I've no idea about Vuforia itself!
   
But i think to remember that Vuforia always gives fov values in landscape mode. So it might be worth a try to do something like
   

cam.setFOV(fovy);
cam.setYFOV(fov);

   
when in portrait mode (i.e. switch the fov values). You might have to adjust the max fov settings in Camera in addition.

lolo

Thanks for the answer.

I try changing the values but didnt work.
The object move in a strange way.  But with a "pattern",what makes me think that is an inverse axis problem, but i miss something.

I didnt change the fov settings in Camera. I try it.

And i post in Vuforia forum too.

Thanks!

Sorry, for my english !

lolo

Hi guys, finally found the answer for this "problem", following this instrucctions in the thread of vuforia forum: https://developer.vuforia.com/forum/android/integrating-jpct-ae-vuforia

credits to: ashunkhs and AlessandroB

This is based on the wiki entry thats integrate Vuforia and JPCT

*

I copy the solution:

First:
i did it another way also as declared in https://developer.vuforia.com/resources/dev-guide/getting-camera-position

// In the java files where we configured the camera
// in the function where we received the inverted Matrix (if you followed the example the function is updateModelviewMatrix)
//

  float cam_right_x = currentMatrix[0];
        float cam_right_y = currentMatrix[1];
        float cam_right_z = currentMatrix[2];
        float cam_up_x = -currentMatrix[4];
        float cam_up_y = -currentMatrix[5];
        float cam_up_z = -currentMatrix[6];
        float cam_dir_x = currentMatrix[8];
        float cam_dir_y = currentMatrix[9];
        float cam_dir_z = currentMatrix[10];

  float cam_x = currentMatrix[12];
        float cam_y = currentMatrix[13];
        float cam_z = currentMatrix[14];

        cam.setOrientation(new SimpleVector(cam_dir_x,cam_dir_y,cam_dir_z),new SimpleVector(-cam_right_x,-cam_right_y,-cam_right_z));
        cam.setPosition(cam_x,cam_y,cam_z);





Hope this helps, thanks!

EgonOlsen

How does this relate to the latest addition to the wiki: http://www.jpct.net/wiki/index.php/Integrating_JPCT-AE_with_Vuforia#Handling_Portrait_Mode? Is that basically the same thing or would it be worth it to add your solution to the wiki?