Integrating JPCT-AE with Vuforia - Rotation of modelViewMatrix

Started by mxar, September 23, 2015, 11:37:11 PM

Previous topic - Next topic

mxar


Hi,

In JPCT-AE  - Vuforia integration procces, the modelview matrix created by Qualcomm's Vuforia engine is rotated 180 degrees around X axis before sending it to jPCT-AE, due to jPCT's coordinate system.

My question is if rotating the modelview matrix will have the result of displaying the 3D Objects upside down.

Also, is it possible JPCT-AE to have the same coordinate system as OpenGL? any special version of JPCT-AE perhaps? or configuration?

Thanks in Advance





EgonOlsen

It shouldn't. Vuforia and jPCT-AE use different spaces, the rotation of the model view matrix transforms it from one into the other. That should actually make the objects appear correct in jPCT and not upside-down.

About making jPCT use the same matrices as OpenGL: No, this won't happen, there's too much that I would have to change for that. It's not just the coordinate system, it's also that OpenGL's matrices are column-major while jPCT's are row-major and adapting for that would change calculation orders all over the place as well. The reasons for this are a) historical and technical ones (for the coordinate system) and b) cultural ones (for the row vs column thing). Or, very briefly: What OpenGL does sucks IMHO.

mxar


Ok, thanks, I understand you.

Also, I have to check my source code about the incorrect appearance of 3d objects.

Also i have another question.The rotated modelview matrix passed from Qualco engine to JPCT-AE is actually the modelview matrix of the marker.

When I insert a 3d object, this has a different modelview matrix?

When i rotate a 3d object calling the Object3D.rotateX() method (or rotateY(),rotateZ()) I noticed that when i move the marker or the camera, the rotated object3D is not actually in the same position, it moves slightly.

The same issue i have when i scale the object3d.

How can i solve this issue? I have to use a difference approach to rotate or scale the object3d?

Thanks in advance


EgonOlsen

Have you had a look at the wiki page about Vuforia? Doesn't it cover this step somehow? The model view matrix is nothing that you can just set into an Object3D. It's not the start of a transformation, it's the end. It's the result of everything that transforms an object from object into camare space.

mxar


Hi,

you mean the http://www.jpct.net/wiki/index.php?title=Integrating_JPCT-AE_with_Vuforia ?

I have followed the directions of this tutorial, it is very helpfull.

Actually I use the java version of detecting a marker instead of C++.

I agree with the "the model view matrix is nothing that you can just set into an Object3D. ... it's the end of transformation."

Well, I check my code deeply.

Thanks for your time.

EgonOlsen

It would be cool, if you could add something about the java version to wiki once you get it working as intended.