Camera Projection Matrix

Hi,

I am working on a project using Augmented Reality, and using Artoolkit plus to obtain my Camera Projection Matrix (an OpenGL 4x4 matrix) the problem is that I dont know how to aplly it, I have already tried :



        ((LWJGLCamera) cam).getProjectionMatrix().loadIdentity();
        ((LWJGLCamera) cam).getProjectionMatrix().set(((LWJGLCamera) cam).getProjectionMatrix().mult(matProjection));
        ((LWJGLCamera) cam).update();



And it doesnt do anything... we already tried using GL11 but nothing changes the image infact if I do

((LWJGLCamera) cam).getProjectionMatrix().get(testMat);



I can see that the projection matrix has been changed :S  but the image stays the same I am still using SimpleGame as we are still making tests.

Any sugestions ?

jME maintains its own context for rendering, so unless you update that context (perhaps with a call to Rederer invalidate or something similar) jME will not use your changes.

I think the getProjectionMatrix() is only for retrieving the matrix from OpenGL. You cannot modify it because jME automatically manages the projection matrices using the algorithms in LWJGLCamera.

Thanks a lot for your quick answer!



So do you know how to extract the information from a projection matrix to be used with the  JME camera class ? 



like for example to use the function setFrustumPerspective, I need data from matrix but I am not being able to get the data right :S






Well there's info on how to get the matrix in here: http://opengl.org/sdk/docs/man/xhtml/gluPerspective.xml

Hi, I want to create application with augmented reality too, and I've tried apply the camera matrix from openGl to the jME camera, but I don't has approach nothing.

In the initGame I try :


// this is the openGL matrix of 16 doubles
double[] matrix = arEngine.getCameraTransformMatrix();
// I apply the matrix values to a Matrix4f. called trans.
float fov = (float) Math.toDegrees(Math.atan(1 / matrix[5]) * 2);
cam.setFrustumPerspective(fov, aspect, (float) 1, 1000);
camNode.setLocalTranslation(trans.toTranslationVector());
camNode.setLocalRotation(trans.toRotationQuad());



I try It, but this has not worked.
@uipe. How do you apply the projection matrix to a jME camera??

Sorry for the l8 replay, this is what I am doing.


float fovy = (float) Math.toDegrees(Math.atan(1 / matrixProjection[5]) * 2);
float aspect = matrixProjection[5] / matrixProjection[0];
cam.setFrustumPerspective(fovy, aspect, (float) 1, 1000);



it's not completly right cause we should be using glfrustum not perspective, but I havent been able to get the right that... I really dont think u need to aplay any rotation or translation.