I’m now creating for the first time an Augmented Reality application. I’m using ARToolkit libraries to obtain the transformation matrix.
In an example this matrix is transformed in a GLformat (3x4 to 1x16 cause the last row is always composed by three zeros and a last one) and the loaded with the function glLoadMatrix in GL_MODELVIEW. Everithing work well…
Now I have the problem that the object i want to see in my AR application is too far from the origin of coordinate system, the far clipping plane don’t let it see…
I read in the red book that glFrustum can help me, so I write this code, but I don’t see anything at all!!
In my opinion mi mistake is the bad use of GL_PROJECTION adn GL_MODELVIEW…
Here I post my code… maybe someone of you know the answer to my question…
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum (-1, 1, -1, 1, 1.5, 20000.0);
glMatrixMode (GL_MODELVIEW);
glLoadMatrixd( gl_para );
glutSolidCube(40);
I tried also this
glMatrixMode(GL_PROJECTION);
glLoadMatrixd( gl_para );
glFrustum (-1, 1, -1, 1, 1.5, 20000.0);
glMatrixMode (GL_MODELVIEW);
glutSolidCube(40);