I'm using the ARToolKit for Android to build an AR app. I can apply the Projection Matrix and the Marker Transformation Matrix in OpenGL without problem, as explained in the ARSimple example. However, I did not find a way to apply correctly these to the jPCT-AE camera. Here is what I did for the camera:
Camera cam = world.getCamera();
Matrix projMatrix = new Matrix();
projMatrix.transformToGL();
projMatrix.setDump(ARToolKit.getInstance().getProjectionMatrix());
cam.setPosition(projMatrix.getTranslation());
cam.setBack(projMatrix);
and for the object:
Matrix objMat = new Matrix();
objMat.transformToGL();
objMat.setDump(ARToolKit.getInstance().queryMarkerTransformation(markerID));
cube.setTranslationMatrix(objMat);
cube.setRotationMatrix(objMat);
It almost works: I can see the 3D object if the marker is placed at the center of the screen. However when I move the marker it quickly disappears off screen. Also, the cube (and other models I tried to load) seems to render in some sort of "inverted" way. For what I read on the web the ARToolKit matrices are relative to OpenGL world coordinates (while jPCT-AE has its own coordinates), and also that the projection matrix of jPCT-AE is built internally based on the fov, near and far clipping plane, position and rotation, and then I cannot set it directly.
How do I translate the projection matrix and marker matrix to the jPCT-AE engine?