Log in or register to post comments

need little help to integrate jpct-ae with vuforia

March 29, 2013 - 6:06am #1

can i ask about jpct here a little? i want to integrate it with vuforia and i have read this page. http://www.jpct.net/wiki/index.php/Integrating_JPCT-AE_with_Vuforia

i stuck at this explanation.

As you can see, I just copied and pasted the code in the Hello World demo and changed the icon reference. I also put the camera object as a field instead of a local variable. We will remove camera initialization later, since we will be handling camera dynamically in accordance to the marker's orientation. But for now, go to ImageTargets.java, then change the initialization of ImageTargetsRenderer to include the activity in the constructor, and remove the line setting this parameter immediately after.

at the bold part, i have include the activity when ImageTargetRenderer is initiated with this code i have modified

mRenderer = new ImageTargetsRenderer(activity);

the activity parameter is an object of my activity, but i dont know what does "and remove the line setting this parameter immediately after." means.. can anybody help me here?

and tell me if my post is out of topic with vuforia forum :(

need little help to integrate jpct-ae with vuforia

June 20, 2013 - 5:59am #10

need little help to integrate jpct-ae with vuforia

April 1, 2013 - 7:52am #9

yes, matrices are typically handled as 1D arrays, this is common in OpenGL programming as well.

 

need little help to integrate jpct-ae with vuforia

March 31, 2013 - 8:37am #8

it's wierd that i found the 4x4 matrix is not actually 2D since i realise this code

jfloatArray modelviewArray = env->NewFloatArray(16);

when jpct tried to pass the array from native. well it is a 1D array, isn't it?

well thx for the advice alessandro, i'll for my experiment later :D, thank you so much..

need little help to integrate jpct-ae with vuforia

March 31, 2013 - 2:43am #7

Hi, you could change the matrix array to a matrix [][] if you like, however that is going to make your JNI code fairly complicated;

if you really need a matrix, you could create a [][] in Java and copy the values with code like this:

for (int i = 0, i < 4; ++i) 
    for (int j = 0, j < 4; ++j) 
        matrix[ i ] [ j ] = array_matrix[ 4 * i + j ];

 

need little help to integrate jpct-ae with vuforia

March 30, 2013 - 9:56pm #6

hei alesandro.. can i ask a little question again here about integrating jpct-ae..

again, i stuck at this explanation

If you run the app now, you will see that you no longer get a teapot if you face the marker with the camera. What we need to do now, is pass through the modelview matrix representing the marker position and orientation from the native code, into our java code. For that matter, we will create a method in ImageTargetsRenderer, that will receive the modelview matrix from the native code. I called this method updateModelViewMatrix, and its parameter is an array of 16 float (which is our 4x4 matrix).

at the bold part, this is wierd, he explained the parameter is an matrix 2D of float, but he write the codes with these:

public void updateModelviewMatrix(float mat[]) {
    modelViewMat = mat;
}

should i change the parameter with mat[][]?

need little help to integrate jpct-ae with vuforia

March 30, 2013 - 10:50am #5

woops.. my bad.. i accidentaly used vuforia 1.5, ahaha.. i found it in vuforia 2.0.. thx for help :D

can i ask some questions later to you if i stuck at something? haha

need little help to integrate jpct-ae with vuforia

March 30, 2013 - 10:40am #4

yes, it is in ImageTargets.java;

if you don't find it, it is the line just after this:

mRenderer = new ImageTargetsRenderer()

 

need little help to integrate jpct-ae with vuforia

March 30, 2013 - 9:56am #3

Hi alessandro.. thx for the reply.. :D

but i can't find the code that you wrote.. is it in ImageTargets.java?

need little help to integrate jpct-ae with vuforia

March 29, 2013 - 7:05am #2

Hi,

I think that statement simply means that you need to remove this line:

mRenderer.mActivity = this;

 

Log in or register to post comments