pramod

01-04-2007, 02:03 AM

I have an MFC_OpenGL Application where I have used gluUnProject() function in it.... & the code goes like this:

glGetDoublev( GL_MODELVIEW_MATRIX, modelview );

glGetDoublev( GL_PROJECTION_MATRIX, projection );

glGetIntegerv( GL_VIEWPORT, viewport );

winX = (float)x;

winY = (float)viewport[3] - (float)y;

glReadPixels( x, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ );

gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);

I have problem in glGetDoublev(GL_MODELVIEW_MATRIX, modelview), here I am not able to get model matrix, when i debug, i get the garbage values for all the 16 values in the MODEL MATRIX...

So plzzzzzz help me in this..

glGetDoublev( GL_MODELVIEW_MATRIX, modelview );

glGetDoublev( GL_PROJECTION_MATRIX, projection );

glGetIntegerv( GL_VIEWPORT, viewport );

winX = (float)x;

winY = (float)viewport[3] - (float)y;

glReadPixels( x, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ );

gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);

I have problem in glGetDoublev(GL_MODELVIEW_MATRIX, modelview), here I am not able to get model matrix, when i debug, i get the garbage values for all the 16 values in the MODEL MATRIX...

So plzzzzzz help me in this..