"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Integration with JPCT-AE

Hi!

 

I am trying to itnegrate QCAR's Vuforia with JPCT-AE and I am close to the perfect solution. I've read this post and I think I might have a similar problem. 

 

So far I've edited ImageTargets native code so that nothing is rendered, only the modelview matrix is sent to my java code, with a proper 180 rotation on the X axis, like this:

 

 

const QCAR::TrackableResult* result = state.getTrackableResult(tIdx);const QCAR::Trackable& trackable = result->getTrackable();QCAR::Matrix44F modelViewMatrix = QCAR::Tool::convertPose2GLMatrix(result->getPose());  SampleUtils::rotatePoseMatrix(180.0f, 1.0f, 0, 0, &modelViewMatrix.data[0]);// Passing the ModelView matrix up to Java (cont.)env->SetFloatArrayRegion(modelviewArray, 0, 16, modelViewMatrix.data);env->CallVoidMethod(obj, method, modelviewArray);  I then use this matrix directly on my camera, and then I can see the object in place. At first the object moved a little bit if I moved the device, but then I sent FOV and FOVY, updated it on my engine so they match, and this movement was suppresed. The problem now is, if I rotate the device "around" the pattern, the object moves slightly. It's not very much but it definitely does not behave like the native example you provide. Where do you think the propblem might be? Maybe I missed some step?

AlessandroB

Wed, 01/23/2013 - 07:03

Hi, so, just to be sure I understand it:

was it behaving correctly before setting the FOV X / Y ?

 

 

No, it was behaving worse. Without the fov/fovy the model also displaced when moving the phone (even in parallel to the target), now it's less noticeable (but it is yet) and it only happens when you turn around the target.

 

bretemasoftware

Wed, 01/23/2013 - 14:19

Thanks, I will try that, but how would you convert those three orientation vectors into something to "look at"?

 

PD. as for the FOV/FOVY, I gather both from QCAR like this:

 

 

bretemasoftware

Thu, 01/24/2013 - 11:51

I finally solved it. I got the same results with your solution than with the modelview matrix. Turns out my objects were badly positioned by jpct-AE (somehow they were what would be "inside" the marker, so I was seeing part of the object that lied "beneath" it.

bretemasoftware

Tue, 02/05/2013 - 17:52

You need to tell jpct that orientation has changed, or you'll be using a framebuffer with the wrong proportions when you switch to portrait. You can either let it know whenever vuforia switches orientation, or simply force it to be landscape, which is what I did.

Hi,

Thanks for the reply.

Actually, in my case, I do have some complicating UI layout on the activity, and that's why I need to set the orientation to portrait mode.

so how do I tell JPCT that the orientation has changed to portrait mode?

penprakash

Fri, 07/12/2013 - 14:18

Hi,

 I have integrated the CloudReco with JPCT-AE and model is loading properly. But if I move the device up(target goes down on the screen) then the 3D object goes right, and move device down then the 3D object goes left.

Please let me know how could i solve this problem.

I get confused when integrate User Define Target with jpct... so far i already change the render in UserDefineTargetRender.java from openGL to jpct-ae..but it crash..and what is RefFreeFrame for??thanks for your help.