Author Topic: Vuforia + JPCT : Portrait Mode  (Read 2502 times)

Offline lolo

  • byte
  • *
  • Posts: 3
    • View Profile
Vuforia + JPCT : Portrait Mode
« on: September 26, 2013, 08:25:16 am »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Vuforia + JPCT : Portrait Mode
« Reply #1 on: September 27, 2013, 03:00:38 pm »
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
   
Code: [Select]
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.

Offline lolo

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Vuforia + JPCT : Portrait Mode
« Reply #2 on: September 27, 2013, 04:14:24 pm »
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 !

Offline lolo

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Vuforia + JPCT : Portrait Mode
« Reply #3 on: December 01, 2013, 08:29:27 pm »
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)
//

Code: [Select]
  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!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Vuforia + JPCT : Portrait Mode
« Reply #4 on: December 02, 2013, 10:37:28 pm »
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?