me_here_me
06-14-2007, 05:13 AM
Hi,
When i use the glFrustum funtion to set up my projection matrix, it works fine. But as soon as I want to calculate the matrix myself, it does not work.
Following code works:
glViewport( 0, 0, (GLsizei)w, (GLsizei)h );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -.4, .4, -.3, .3, 1., 1300. );
glMatrixMode( GL_MODELVIEW );
// continues
the following does not :(
glViewport( 0, 0, (GLsizei)w, (GLsizei)h );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
matrix4x4 projection;
projection = calculateFrustum(-.4, .4, -.3, .3, 1., 1300.);
glLoadMatrixf(projection);
glMatrixMode( GL_MODELVIEW );
// code continues
Some how my calculation of the Frustum matrix does not match that of the one calculated by the openGl. Can you please point out whats wrong in here.
I am using the defination given on the following page for "calculateFrsutum" funtions call:
http://msdn2.microsoft.com/en-us/library/ms537094.aspx
thanks in advance
When i use the glFrustum funtion to set up my projection matrix, it works fine. But as soon as I want to calculate the matrix myself, it does not work.
Following code works:
glViewport( 0, 0, (GLsizei)w, (GLsizei)h );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -.4, .4, -.3, .3, 1., 1300. );
glMatrixMode( GL_MODELVIEW );
// continues
the following does not :(
glViewport( 0, 0, (GLsizei)w, (GLsizei)h );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
matrix4x4 projection;
projection = calculateFrustum(-.4, .4, -.3, .3, 1., 1300.);
glLoadMatrixf(projection);
glMatrixMode( GL_MODELVIEW );
// code continues
Some how my calculation of the Frustum matrix does not match that of the one calculated by the openGl. Can you please point out whats wrong in here.
I am using the defination given on the following page for "calculateFrsutum" funtions call:
http://msdn2.microsoft.com/en-us/library/ms537094.aspx
thanks in advance