related code is as below:
int ww = glutGet( (GLenum)GLUT_WINDOW_WIDTH );
int wh = glutGet( (GLenum)GLUT_WINDOW_HEIGHT );
glClearColor(1.0,1.0,1.0,1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
intensitymap=(GLushort*)malloc(wwwh6);
glReadBuffer(GL_FRONT);
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0,0,ww,wh,GL_RGB,GL_UNSIGNED_SHORT,intensitymap);
The problem is:
because the image background is white, there should be a lot of pixels with value of r=65535,g=65535 and b=65535.
but actually, it is not. a lot of other values.
and, when I save this array to a file, for example, ppm image file, and then open it in photoshop, the rendering result is right.
It almost drive me mad!!!
help. and thanks a lot!!!