Log in or register to post comments

Integrating JPCT-AE with Vuforia

April 12, 2013 - 3:31am #1

Hi guies..

 

I am Integrating JPCT-AE with Vuforia for  as  Vuforia sample Imagetarget teaport model.
 
I followed the kelmar and  Sam Rad 's  answer on 
 
 
 
And now I am able to render my model as well as teaport in landscape mode only.
 
:::::AND :::::::
 
When i make changes in `initApplication()` in imagetarget
 
    int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR; or  ORIENTATION_PORTRATE;
 
My model start rendering here and there on the screen means not as tea-port render.
 
As I understand we need to change the matrix something to render model in  portrait mode.
 
But how and what. I do't know. If you have any idea, please refer me shortly.
 
 
 
...............thanks

Integrating JPCT-AE with Vuforia

August 7, 2013 - 5:58am #7

Hi ashunkhs/ AlessandroB,

 

   I have the same issue, how to i swap the x and y axis in jpct camera to track the image?

 

Thanks & Regards,

Prakash V

Integrating JPCT-AE with Vuforia

April 16, 2013 - 1:40am #6

Happy that your first issue is solved.

Concerning your "ellipse-like" visualization issue, this is probably due to an incorrect aspect ration of your JPCT camera; you should set the aspect ratio so to match the ratio between the view width and view height.

 

Integrating JPCT-AE with Vuforia

April 16, 2013 - 1:23am #5

thanks dude 

i got it .

thank u very much.

 

but there is a small problem . i attached two screenshort .

i am loading a cercle but it renderig like eclipse . it happens with all the models.

if there is any solution pls check it.

Integrating JPCT-AE with Vuforia

April 15, 2013 - 11:52pm #4

Hi,

I'm not too familiar with the JPCT SDK, but have you tried with cam.setOrientation(dir, up), where:

dir.x = cam_dir_x;

dir.y = cam_dir_y;

dir.z = cam_dir_z;

 

up.x = -cam_right_x;

up.y = -cam_right_y;

up.z = -cam_right_z;

and:

 

float cam_x = invTranspMV.data[12];
float cam_y = invTranspMV.data[13];
float cam_z = invTranspMV.data[14];
 
cam.setPosition(cam_x, cam_y, cam_z);
 
?

Integrating JPCT-AE with Vuforia

April 15, 2013 - 10:14pm #3

HI 

As u refer me the link 

i got the x and y axis and  swap it as :

 

jmethodID updateInvTranspMV = env->GetMethodID(activityClass, "updateInvTranspMV", "([F)V");
jfloatArray InvTranspMVArray = env->NewFloatArray(16);
 
for(int tIdx = 0; tIdx < state.getNumTrackableResults(); tIdx++)
{
 
QCAR::Matrix44F inverseMV = SampleMath::Matrix44FInverse(modelViewMatrix);
QCAR::Matrix44F invTranspMV = SampleMath::Matrix44FTranspose(inverseMV);
 
// Passes the invTranspMV matrix to java
env->SetFloatArrayRegion(InvTranspMVArray, 0, 16, invTranspMV.data);
env->CallVoidMethod(obj, updateInvTranspMV , InvTranspMVArray);
 
}
 
 
once i got this matix in java i set in JPCT camera obj as:
 
Matrix n = new Matrix();
n.setDump(InvTranspMV);
 x= n.getXAxis();
y = n.getYAxis();
cam.setOrientation(y,x);
 
::::::::And::::::::
 
 
i got  X & Y  as
 
float cam_right_x = invTranspMV.data[0];
float cam_right_y = invTranspMV.data[1];
float cam_right_z = invTranspMV.data[2];
float cam_up_x = -invTranspMV.data[4];
float cam_up_y = -invTranspMV.data[5];
float cam_up_z = -invTranspMV.data[6];
float cam_dir_x = invTranspMV.data[8];
float cam_dir_y = invTranspMV.data[9];
float cam_dir_z = invTranspMV.data[10];
 
 
then swap X & Y and set it to JPCT camera 
cam.setOrientation(x,y);
 
but i got same as in upper case.
 
................after it  i set the  camere possition.....................................................................
 
//Extract the camera position from the last column of the invTranspMV
float cam_x = invTranspMV.data[12];
float cam_y = invTranspMV.data[13];
float cam_z = invTranspMV.data[14];
 
cam.setPosition(PossitionX, PossitionY, PossirionZ);
and now  my model is ecome invissible on the screen.
................................................................................................................................................................................. 
 
 
 
i think its same as u refer to me to do.
but  it still not as rendering as model in landscape .
when i set the orientation to JPCT camera obj  , model come to extream left corner.
 
if its wrong way to set orientation then pls refer the right .
or if it is the right  then pls told me the next way. 
 
 
thanks  !!!!

 

Integrating JPCT-AE with Vuforia

April 12, 2013 - 7:45am #2

Hi,

the issue might be related to the fact that you in portrait mode you need to swap the X and Y axis, since the Vuforia axis system are somehow defined in landscape mode.

One useful article that you could read is this:

https://developer.vuforia.com/resources/dev-guide/getting-camera-position

Then, you could set your JPCT camera using the axis extracted as explaiend in the article above, and just swap the X and Y axis.

 

Log in or register to post comments